import { EventTarget as ot, Node as qt, Link as $e, Rectangle as tn, EventBase as Fe, setProto as q, RegSystem as z, AENode as Jt, Animation as N, Shape as en, AnchorUsageType as nn, ImageNode as sn } from "@jtopo/core";
const H = et;
function et(n, t) {
  const e = Gt();
  return (et = function(i, r) {
    return e[i -= 235];
  })(n, t);
}
function Gt() {
  const n = ["initEvent", "12087osrRMB", "23190PCtVQm", "height", "innerHTML", "2653735LjouuT", "remove", "forEach", "70511bdoNtc", "createElement", "jtopo_popoupmenu", "1815456wHagJW", "stage", "appendChild", "setHtml", "block", "248lGGEhZ", "dispatchEvent", "style", "defaultPrevented", "offsetWidth", "1143330RSqxbe", "domElement", "none", "width", "1446552IpvyKS", "8sDeVjG", "14vjzCtD"];
  return (Gt = function() {
    return n;
  })();
}
(function() {
  const n = et, t = Gt();
  for (; ; )
    try {
      if (-parseInt(n(246)) / 1 * (-parseInt(n(237)) / 2) + parseInt(n(249)) / 3 + -parseInt(n(236)) / 4 * (parseInt(n(259)) / 5) + parseInt(n(235)) / 6 + -parseInt(n(243)) / 7 + -parseInt(n(254)) / 8 * (parseInt(n(239)) / 9) + parseInt(n(240)) / 10 === 464070)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Bn extends ot {
  constructor(t, e) {
    const i = et;
    super(), this[i(250)] = t, this.domElement = this[i(252)](e);
  }
  [H(244)]() {
    const t = H;
    this.domElement != null && this.domElement[t(244)]();
  }
  setHtml(t) {
    const e = H;
    this.html = t, this.remove();
    let i = document[e(247)]("div");
    return i.classList.add(e(248)), this.stage.layersContainer[e(251)](i), i.innerHTML = t, this[e(238)](i), this.domElement = i, this.hide(), i;
  }
  [H(238)](t) {
    const e = H;
    let i = this;
    t.querySelectorAll("a")[e(245)](function(r) {
      r.addEventListener("click", function(o) {
        const s = et;
        let l = new Event("select", { cancelable: !0 });
        l.item = this[s(242)], i[s(255)](l), l[s(257)] || i.hide();
      });
    });
  }
  showAt(t, e) {
    const i = H;
    let r = this[i(260)], o = this[i(250)];
    r.style.display = i(253), e + r.offsetHeight >= o.height && e > o[i(241)] / 2 && (e -= r.offsetHeight), t + r[i(258)] >= o[i(262)] && t > o.width / 2 && (t -= r[i(258)]), r[i(256)].left = t + "px", r.style.top = e + "px";
  }
  hide() {
    const t = H;
    this.domElement[t(256)].display = t(261);
  }
}
const F = bt;
function Yt() {
  const n = ["fadeOut", "setHtml", "2286544mbLsno", "265246tCBDGF", "11PIMRSF", "15724Mfdrnn", "2779gtMlNz", "stage", "3JRPvWy", "pointerup", "400MszmvM", "domElement", "116213GFmOxv", "transition", "pointerdown", "197900EHIguE", "4800KiCYsK", "appendChild", "6891156vZFttt", "top", "add", "style", "117dsYYdI", "enabled"];
  return (Yt = function() {
    return n;
  })();
}
function bt(n, t) {
  const e = Yt();
  return (bt = function(i, r) {
    return e[i -= 360];
  })(n, t);
}
(function() {
  const n = bt, t = Yt();
  for (; ; )
    try {
      if (-parseInt(n(367)) / 1 + parseInt(n(382)) / 2 * (-parseInt(n(363)) / 3) + -parseInt(n(360)) / 4 * (-parseInt(n(365)) / 5) + -parseInt(n(371)) / 6 * (parseInt(n(361)) / 7) + -parseInt(n(381)) / 8 + parseInt(n(377)) / 9 * (parseInt(n(370)) / 10) + -parseInt(n(383)) / 11 * (-parseInt(n(373)) / 12) === 293759)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Dn extends ot {
  constructor(t) {
    const e = bt;
    super(), this.stage = t, this.domElement = document.createElement("div"), this.domElement.classList[e(375)]("jtopo_tooltip"), this.domElement.style[e(368)] = "opacity 1s ease-in-out", this.stage.layersContainer[e(372)](this.domElement), this.initEvent(), this.fadeOut();
  }
  disable() {
    this.domElement && this.domElement.remove();
  }
  [F(378)]() {
    const t = F;
    this.domElement && this.domElement.parentNode == null && this[t(362)].layersContainer.appendChild(this[t(366)]);
  }
  [F(380)](t) {
    const e = F;
    return this.domElement.innerHTML = t, this[e(366)];
  }
  initEvent() {
    const t = F, e = this, i = this[t(362)].inputSystem;
    i.addEventListener(t(369), function() {
      e[t(379)]();
    }), i.addEventListener(t(364), function() {
      e.fadeOut();
    }), i.addEventListener("pointermove", function() {
      i.mouseoverTarget == null && e.fadeOut();
    });
  }
  showAt(t, e) {
    const i = F;
    this.domElement[i(376)].display = "block", this.domElement.style.left = t + "px", this[i(366)].style[i(374)] = e + "px", requestAnimationFrame(() => {
      this.domElement.style.opacity = "1";
    });
  }
  fadeOut() {
    const t = F;
    this.domElement[t(376)].opacity = "0", setTimeout(() => {
      const e = t;
      this[e(366)][e(376)].opacity === "0" && (this.domElement[e(376)].display = "none");
    }, 100);
  }
}
const nt = Zt;
function Zt(n, t) {
  const e = Vt();
  return (Zt = function(i, r) {
    return e[i -= 431];
  })(n, t);
}
function Vt() {
  const n = ["41760FxGDBj", "21EJlgpQ", "createElement", `
<svg viewBox="0 0 24 24" id="zoom-in">
<path d="M4,20 L9.58788778,14.4121122"/>
<path d="M14,16 C10.6862915,16 8,13.3137085 8,10 C8,6.6862915 10.6862915,4 14,4 C17.3137085,4 20,6.6862915 20,10 C20,13.3137085 17.3137085,16 14,16 Z"/>
<path d="M16.6666667 10L11.3333333 10M14 7.33333333L14 12.6666667"/>
</svg>
<svg viewBox="0 0 24 24" id="zoom-out">
<path d="M14,16 C10.6862915,16 8,13.3137085 8,10 C8,6.6862915 10.6862915,4 14,4 C17.3137085,4 20,6.6862915 20,10 C20,13.3137085 17.3137085,16 14,16 Z"/>
<path d="M16.6666667 10L11.3333333 10M4 20L9.58788778 14.4121122"/>
</svg>
<svg viewBox="0 0 24 24" id="back-left">
<path d="M5,17 L5,15 C5,10.0294373 8.80557963,6 13.5,6 C18.1944204,6 22,10.0294373 22,15"/>
<polyline points="8 15 5 18 2 15"/>
</svg>
<svg viewBox="0 0 24 24" id="align-center">
<path d="M8 10L16 10M6 6L18 6M6 14L18 14M8 18L16 18"/>
</svg>
<svg viewBox="0 0 24 24" id="edit">
<path d="M18.4142136 4.41421356L19.5857864 5.58578644C20.366835 6.36683502 20.366835 7.63316498 19.5857864 8.41421356L8 20 4 20 4 16 15.5857864 4.41421356C16.366835 3.63316498 17.633165 3.63316498 18.4142136 4.41421356zM14 6L18 10"/>
</svg>
<svg viewBox="0 0 24 24" id="lock-alt">
<rect width="14" height="10" x="5" y="11"/>
<path d="M12,3 L12,3 C14.7614237,3 17,5.23857625 17,8 L17,11 L7,11 L7,8 C7,5.23857625 9.23857625,3 12,3 Z"/>
<circle cx="12" cy="16" r="1"/>
</svg>
<svg viewBox="0 0 24 24" id="lock-open">
<path d="M7,7.625 L7,7 C7,4.23857625 9.23857625,2 12,2 L12,2 C14.7614237,2 17,4.23857625 17,7 L17,11"/>
<rect width="14" height="10" x="5" y="11"/>
</svg>
<svg viewBox="0 0 24 24" id="pan">
<path d="M20,14 L20,17 C20,19.209139 18.209139,21 16,21 L10.0216594,21 C8.75045497,21 7.55493392,20.3957659 6.80103128,19.3722467 L3.34541668,14.6808081 C2.81508416,13.9608139 2.94777982,12.950548 3.64605479,12.391928 C4.35756041,11.8227235 5.38335813,11.8798792 6.02722571,12.5246028 L8,14.5 L8,13 L8.00393081,13 L8,11 L8.0174523,6.5 C8.0174523,5.67157288 8.68902517,5 9.5174523,5 C10.3458794,5 11.0174523,5.67157288 11.0174523,6.5 L11.0174523,11 L11.0174523,4.5 C11.0174523,3.67157288 11.6890252,3 12.5174523,3 C13.3458794,3 14.0174523,3.67157288 14.0174523,4.5 L14.0174523,11 L14.0174523,5.5 C14.0174523,4.67157288 14.6890252,4 15.5174523,4 C16.3458794,4 17.0174523,4.67157288 17.0174523,5.5 L17.0174523,11 L17.0174523,7.5 C17.0174523,6.67157288 17.6890252,6 18.5174523,6 C19.3458794,6 20.0174523,6.67157288 20.0174523,7.5 L20.0058962,14 L20,14 Z"/>
</svg>
<svg viewBox="0 0 24 24" id="apps-alt">
<rect x="5" y="5" width="2" height="2"/>
<rect x="11" y="5" width="2" height="2"/>
<rect x="17" y="5" width="2" height="2"/>
<rect x="5" y="11" width="2" height="2"/>
<rect x="11" y="11" width="2" height="2"/>
<rect x="17" y="11" width="2" height="2"/>
<rect x="5" y="17" width="2" height="2"/>
<rect x="11" y="17" width="2" height="2"/>
<rect x="17" y="17" width="2" height="2"/>
</svg>
<svg viewBox="0 0 24 24" id="maximise">
<polyline points="21 16 21 21 16 21"/>
<polyline points="8 21 3 21 3 16"/>
<polyline points="16 3 21 3 21 8"/>
<polyline points="3 8 3 3 8 3"/>
</svg>
<svg viewBox="0 0 24 24" id="minimise">
<polyline points="8 3 8 8 3 8"/>
<polyline points="21 8 16 8 16 3"/>
<polyline points="3 16 8 16 8 21"/>
<polyline points="16 21 16 16 21 16"/>
</svg>
<svg viewBox="0 0 24 24" id="download">
<path d="M12,3 L12,16"/>
<polyline points="7 12 12 17 17 12"/>
<path d="M20,21 L4,21"/>
</svg>
<svg viewBox="0 0 24 24" id="rectangle">
<rect width="18" height="18" x="3" y="3"/>
</svg>
<svg viewBox="0 0 24 24" id="cursor">
<polygon points="7 20 7 4 19 16 12 16 7 21"/>
</svg>
<svg viewBox="0 0 24 24" id="search">
<path d="M14.4121122,14.4121122 L20,20"/>
<circle cx="10" cy="10" r="6"/>
</svg>
<svg viewBox="0 0 24 24" id="eye">
<path d="M22 12C22 12 19 18 12 18C5 18 2 12 2 12C2 12 5 6 12 6C19 6 22 12 22 12Z"/>
<circle cx="12" cy="12" r="3"/>
</svg>
<svg viewBox="0 0 24 24" id="save">
<path d="M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z"/>
<rect width="10" height="8" x="7" y="13"/>
<rect width="8" height="5" x="8" y="3"/>
</svg>
<svg viewBox="0 0 24 24" id="image">
<rect width="18" height="18" x="3" y="3"/>
<path stroke-linecap="round" d="M3 14l4-4 11 11"/>
<circle cx="13.5" cy="7.5" r="2.5"/>
<path stroke-linecap="round" d="M13.5 16.5L21 9"/>
</svg>
<svg viewBox="0 0 24 24" id="upload">
<path d="M12,4 L12,17"/>
<polyline points="7 8 12 3 17 8"/>
<path d="M20,21 L4,21"/>
</svg>
`, "798952BHNJAf", "300765uENPDc", "1526092tCVsow", "querySelector", "div", "62025glrHps", "get", "2189436VFBCVi", "5736qFQkDd"];
  return (Vt = function() {
    return n;
  })();
}
(function() {
  const n = Zt, t = Vt();
  for (; ; )
    try {
      if (-parseInt(n(438)) / 1 + -parseInt(n(441)) / 2 + parseInt(n(442)) / 3 + parseInt(n(435)) / 4 + -parseInt(n(434)) / 5 + -parseInt(n(440)) / 6 + parseInt(n(443)) / 7 * (parseInt(n(433)) / 8) === 205098)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
let rn = nt(432), Re = document[nt(431)](nt(437));
Re.innerHTML = rn;
let Xt = {};
function Kt(n, t) {
  const e = Qt();
  return (Kt = function(i, r) {
    return e[i -= 231];
  })(n, t);
}
Xt[nt(439)] = function(n) {
  return Re[nt(436)]("#" + n);
};
const y = Kt;
function Qt() {
  const n = ["camera", `</button>
<button title="浏览器全屏" class="item" iconId='maximise'>`, "result", "then", "edit", "5717396FGSoFM", "key", "select", "onclick", "1440900LZfvKo", "214870wjtOxe", "classList", "overview", "1214490hZUMGA", "1731696aUlWWC", "drag", "lookAtObject", "stringify", "rectangle", `</button>
<div style="display:none;"><input type="file"/></div>
</div>
`, "559137StgbJl", "showButton", "querySelector", "buttons", "getCurrentLayer", "jtopo_toolbar", "onload", "zoom-out", "stage", "parentNode", `</button>
<button title="框选模式" class="item" group='mode' iconId='rectangle'>`, "remove", "target", "none", "13398MscaVA", `</button>
<input title="查找" type="text" placeholder="查找" value=""></input>
<button class="item" iconId='search'>`, "prepend", `</button>
<button title="锁定模式" class="item" group='mode' iconId='lock-alt'>`, "addEventListener", "text", "setMode", "upload", `</button>
<button title="缩小"  class="item" iconId='zoom-out'>`, "imageToBase64", "zoom", '<input type="file"/>', "minimise", 'input[type="file"]', "5VKhdmj", "files", "effectSystem", "normal", "toJSON", "getAttribute", "removeAllActive", "2233aoheal", "block", "parse", `</button>
</div>
<div class="group">
<button title="缩略图" class="item" iconId='eye'>`, "domObj", "954HvDHBP", ".json", "activeButton", "save", 'button[title="', "readAsText"];
  return (Qt = function() {
    return n;
  })();
}
function b(n) {
  return Xt.get(n).outerHTML;
}
(function() {
  const n = Kt, t = Qt();
  for (; ; )
    try {
      if (parseInt(n(264)) / 1 + -parseInt(n(253)) / 2 + -parseInt(n(257)) / 3 + -parseInt(n(249)) / 4 * (parseInt(n(292)) / 5) + -parseInt(n(278)) / 6 * (-parseInt(n(233)) / 7) + -parseInt(n(258)) / 8 + -parseInt(n(238)) / 9 * (-parseInt(n(254)) / 10) === 777995)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
let on = `
<div class="group">
<button title="默认" class="item active" group='mode' iconId='cursor'>` + b("cursor") + `</button>
<button title="编辑模式" edit="true" class="item" group='mode' iconId='edit' style="display:none">` + b(y(248)) + y(274) + b(y(262)) + `</button>
<button title="拖拽模式"  class="item" group='mode' iconId='pan'>` + b("pan") + y(281) + b("lock-alt") + `</button>
</div>
<div class="group">
<button title="放大"  class="item" iconId='zoom-in'>` + b("zoom-in") + y(286) + b(y(271)) + `</button>
<button title="居中" class="item" iconId='align-center'>` + b("align-center") + `</button>
<button title="缩放至画布" class="item" iconId='minimise'>` + b(y(290)) + `</button>
<button title="取消缩放" class="item" iconId='back-left'>` + b("back-left") + y(236) + b("eye") + y(245) + b("maximise") + y(279) + Xt.get("search").outerHTML + `</button>
</div>
<div class="group">
<button title="导出PNG" class="item" iconId='image'>` + b("image") + `</button>
<button title="打开本地文件" class="item" iconId='upload'>` + b(y(285)) + `</button>
<button title="保存到本地" class="item" iconId='save'>` + b(y(241)) + y(263);
class Wn {
  constructor(t) {
    const e = y;
    this.imageToBase64 = !0, this[e(272)] = t, this.initToolbar(t, on), t.domElement[e(280)](this.getDom());
    let i = this;
    setTimeout(function() {
      i.initActiveStatus();
    }, 200);
  }
  [y(265)](t) {
    const e = y;
    let i = this[e(237)].querySelector(e(242) + t + '"]');
    i != null && (i.style.display = "block");
  }
  hideButton(t) {
    let e = this.domObj.querySelector('button[title="' + t + '"]');
    e != null && (e.style.display = "none");
  }
  getDom() {
    return this.domObj;
  }
  show() {
    const t = y;
    this.domObj.style.display = t(234);
  }
  hide() {
    const t = y;
    this.domObj.style.display = t(277);
  }
  remove() {
    const t = y;
    this.domObj[t(275)]();
  }
  initActiveStatus() {
    if (this[y(272)].mode == "edit") {
      let t = document.querySelector("button[iconid='edit']");
      this.activeButton(t);
    }
  }
  initToolbar(t, e) {
    const i = y;
    let r = this, o = document.createElement("div");
    this[i(237)] = o, o.classList.add(i(269)), o.innerHTML = e;
    let s = o.querySelectorAll("button");
    this.buttons = s;
    let l = o[i(266)](i(291)), a = l[i(273)];
    function h(d) {
      const m = i;
      a.innerHTML = m(289), c();
      let x = d[m(276)][m(293)][0];
      const v = new FileReader();
      v[m(243)](x), v[m(270)] = function() {
        const S = m;
        try {
          const C = JSON[S(235)](this[S(246)]);
          r.stage.fromJSON(C).then(() => {
            document.title = x.name;
          });
        } catch (C) {
          console.log(C), alert("加载出现错误");
        }
      };
    }
    function c() {
      const d = i;
      l = o[d(266)]('input[type="file"]'), l[d(282)]("change", h);
    }
    function u() {
      const d = i;
      let m = t[d(268)](), x = o.querySelector('input[type="text"]').value;
      if (x.length > 0) {
        let v = m[d(266)](function(S) {
          const C = d;
          return S.text != null && S[C(283)].indexOf(x) != -1;
        });
        v && (t.camera[d(260)](v), t[d(294)].flash(v).play());
      }
    }
    c(), this.fileInput = l;
    let f = { cursor: function() {
      const d = i;
      t[d(284)](d(295));
    }, rectangle: function() {
      const d = i;
      t.setMode(d(251));
    }, pan: function() {
      const d = i;
      t.setMode(d(259));
    }, edit: function() {
      t.setMode("edit");
    }, "lock-alt": function() {
      t.setMode("view");
    }, eye: function() {
      t[i(256)] == null || t.overview.visible == 0 ? t.showOverview() : t.hideOverview();
    }, "zoom-in": function() {
      t.camera.zoomIn();
    }, "zoom-out": function() {
      t.camera.zoomOut();
    }, "back-left": function() {
      const d = i;
      t.camera.lookAt(0, 0), t.camera[d(288)](1);
    }, minimise: function() {
      t[i(244)].zoomToFit();
    }, "align-center": function() {
      t.camera.lookAtContentCenter();
    }, maximise: function() {
      t.fullWindow();
    }, image: function() {
      t.saveImageInfo();
    }, save: async function() {
      const d = i;
      let m = prompt("要保存的文件名："), x = r[d(287)];
      if (m != null)
        if (x)
          t.toJSONWithBase64()[d(247)]((v) => {
            const S = d;
            let C = JSON.stringify(v);
            t.download(m + S(239), C);
          });
        else {
          let v = t[d(296)](), S = JSON[d(261)](v);
          t.download(m + ".json", S);
        }
    }, upload: function() {
      l.click();
    }, search: u };
    function p(d) {
      const m = i;
      d[m(252)] = function() {
        let x = d[m(231)]("iconId");
        f[x](), r.activeButton(d);
      };
    }
    o.querySelector("input").onkeydown = function(d) {
      d[i(250)] == "Enter" && u();
    };
    for (let d = 0; d < s.length; d++)
      p(s[d]);
  }
  [y(240)](t) {
    const e = y;
    let i = t;
    typeof t == "string" && (i = this.domObj.querySelector(e(242) + t + '"]'));
    let r = i.getAttribute("group");
    r != null && (this[e(232)](r), i[e(255)].add("active"));
  }
  [y(232)](t) {
    const e = y;
    let i = this[e(267)];
    for (let r = 0; r < i.length; r++) {
      let o = i[r];
      t == o[e(231)]("group") && o[e(255)].remove("active");
    }
  }
}
const w = It;
(function() {
  const n = It, t = $t();
  for (; ; )
    try {
      if (parseInt(n(304)) / 1 * (-parseInt(n(328)) / 2) + -parseInt(n(324)) / 3 * (-parseInt(n(308)) / 4) + -parseInt(n(314)) / 5 + -parseInt(n(330)) / 6 * (-parseInt(n(302)) / 7) + -parseInt(n(343)) / 8 * (-parseInt(n(305)) / 9) + -parseInt(n(315)) / 10 + parseInt(n(335)) / 11 * (parseInt(n(340)) / 12) === 456844)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class _e extends Fe {
  constructor(t, e) {
    super(t, e);
  }
}
class Hn extends ot {
  constructor(t) {
    const e = It;
    super(), this.disabled = !1, this.stage = t;
    let i = document.createElement(e(331));
    i.classList.add("jtopo_input_textfield"), this.stage.layersContainer[e(351)](i), this.measurementSpan = this.createMeasurementSpan();
    let r = this;
    i[e(316)] = function(o) {
      r.onkeydown(o);
    }, i.oninput = function(o) {
      r.inputHandler(o);
    }, this.textarea = i, t.inputSystem.addEventListener("dblclick", this[e(301)][e(313)](this)), t.inputSystem.addEventListener("pointerdown", this[e(338)].bind(this)), t.inputSystem.addEventListener("pointerup", this[e(350)].bind(this)), t.inputSystem[e(303)]("pointermove", this.pointerHandler.bind(this)), document[e(303)](e(311), this.docPointdownHandler[e(313)](this)), t.camera.addEventListener("zoom", this.zoomHandler[e(313)](this));
  }
  zoomHandler(t) {
    this.hide();
  }
  docPointdownHandler(t) {
    let e = t.target;
    e != null ? e !== this.textarea && this.hide() : this.hide();
  }
  inputHandler(t) {
    this.target != null && this.adjustTextareaWidth();
  }
  [w(347)]() {
    const t = w;
    let e = document.createElement(t(317));
    return e.classList.add("jtopo_measurement_span"), e[t(345)].visibility = "hidden", e.style.position = "absolute", e.style.whiteSpace = "pre-wrap", e.style.wordWrap = "none", e.style.display = t(309), e.style.minWidth = "10px", this[t(346)][t(321)].appendChild(e), e;
  }
  dblclickHandler(t) {
    if (this.disabled)
      return;
    let e = this.stage.inputSystem.target;
    e != null ? this.attachTo(e) : this.cancel();
  }
  [w(306)](t) {
    this[w(346)].inputSystem.isPointerDown && this.cancel();
  }
  [w(338)](t) {
    this.stage.inputSystem.target == null && this.cancel();
  }
  [w(350)](t) {
    const e = w;
    this[e(346)].inputSystem[e(320)] == null && this.cancel();
  }
  attachTo(t) {
    const e = w;
    let i;
    if (this.hide(), this.target = t, t instanceof qt ? i = t : t instanceof $e && (i = t.getLabel()), i == null)
      return;
    let r = new tn(0, 0, i._textWidth, i._textHeight), o = this.stage.camera.toScreenRect(r), s = i[e(325)](), l = parseInt(s.fontSize) * this.stage.camera.scale;
    this.textarea.style[e(329)] = s.fontFamily, this[e(331)][e(345)].fontWeight = s.fontWeight, this.textarea.style.fontSize = l + "px", this.measurementSpan[e(345)].fontFamily = s.fontFamily, this.measurementSpan.style.fontWeight = s.fontWeight, this[e(327)][e(345)].fontSize = l + "px";
    let a = s.textAlign, h = s[e(307)], c = i._textPosition, u = i[e(312)](c.x, c.y), f = this.stage.camera[e(318)](u.x, u.y), p = Math.max(o.width, 30), d = Math.max(o.height, 20), m = f.x - p / 2, x = f.y - d / 2;
    a == "left" ? m = f.x - p / 2 : a == "right" && (m = f.x + p / 2), h == "top" ? x = f.y - d / 2 : h == "bottom" && (x = f.y + d / 2), this.textX = m, this.textY = x, this.setValue(i.text), this.show();
  }
  setValue(t) {
    const e = w;
    this.textarea.value = t, this[e(326)]();
  }
  show() {
    const t = w;
    this.textarea.style[t(310)] = t(337), this.textarea.focus(), this.textarea.select(), this.textarea[t(345)].left = this.textX + "px", this.textarea[t(345)].top = this.textY + "px", this.adjustTextareaWidth();
  }
  hide() {
    const t = w;
    this[t(331)][t(345)][t(310)] = "none";
  }
  onkeydown(t) {
    const e = w;
    if (t.key != "Escape") {
      if (t.key == "Enter") {
        if (t[e(334)]) {
          const i = this.textarea, r = i.selectionStart, o = i.selectionEnd;
          i.value = i[e(323)].substring(0, r) + `
` + i.value[e(342)](o), i[e(333)] = i[e(319)] = r + 1, this.adjustTextareaWidth();
        } else {
          if (this.target == null)
            return;
          this.applyInput();
        }
        t[e(339)]();
      }
    } else
      this.cancel();
  }
  [w(348)]() {
    const t = w;
    let e = this[t(320)];
    if (e == null)
      return;
    const i = this.textarea;
    let r = new _e("confirm", { target: e, text: i[t(323)] });
    this.dispatchEvent(r), this[t(332)](), r.defaultPrevented || (e.text = i.value);
  }
  cancel() {
    const t = w;
    let e = this[t(320)];
    e != null && (this[t(332)](), this.dispatchEvent(new _e("cancel", { target: e })));
  }
  adjustTextareaWidth() {
    const t = w;
    let e = this.measurementSpan;
    e[t(352)] = this.textarea.value;
    const i = e.offsetWidth + 10;
    this.textarea.style.width = i + "px", this.textarea.style.height = t(344), this[t(331)].style.height = this.textarea.scrollHeight + "px";
  }
  [w(322)]() {
    const t = w;
    this.textarea[t(316)] = null, this.textarea.oninput = null, document.removeEventListener(t(311), this.docPointdownHandler), this.removeEventListener(t(349), this.dblclickHandler), this[t(341)](t(311), this.pointerdownHandler), this.removeEventListener("pointerup", this.pointerupHandler), this.removeEventListener("pointermove", this.pointerHandler), this[t(331)][t(336)]();
  }
}
function It(n, t) {
  const e = $t();
  return (It = function(i, r) {
    return e[i -= 301];
  })(n, t);
}
function $t() {
  const n = ["7zWaiLd", "addEventListener", "1hhcXkH", "9rGBDLn", "pointerHandler", "textBaseline", "265132aJjQiv", "inline-block", "display", "pointerdown", "localToWorldXY", "bind", "4327170SCuNwM", "2353170eyJVxu", "onkeydown", "span", "toScreenXY", "selectionEnd", "target", "layersContainer", "destroy", "value", "15GTWwpa", "getComputedStyle", "adjustTextareaWidth", "measurementSpan", "396158eFrdUr", "fontFamily", "2835354WbkYNg", "textarea", "hide", "selectionStart", "ctrlKey", "561649KSMIHZ", "remove", "block", "pointerdownHandler", "preventDefault", "12hIQDiQ", "removeEventListener", "substring", "7205128CTemql", "auto", "style", "stage", "createMeasurementSpan", "applyInput", "dblclick", "pointerupHandler", "appendChild", "textContent", "dblclickHandler"];
  return ($t = function() {
    return n;
  })();
}
const P = te;
function te(n, t) {
  const e = ee();
  return (te = function(i, r) {
    return e[i -= 339];
  })(n, t);
}
(function() {
  const n = te, t = ee();
  for (; ; )
    try {
      if (parseInt(n(358)) / 1 * (parseInt(n(357)) / 2) + parseInt(n(346)) / 3 * (parseInt(n(353)) / 4) + -parseInt(n(362)) / 5 * (parseInt(n(360)) / 6) + -parseInt(n(347)) / 7 * (-parseInt(n(343)) / 8) + parseInt(n(341)) / 9 + parseInt(n(348)) / 10 + parseInt(n(344)) / 11 * (-parseInt(n(349)) / 12) === 994893)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var an = Object[P(352)], ln = Object.getOwnPropertyDescriptor;
class Ne extends qt {
  constructor(t, e = 0, i = 0, r = 1, o = 1) {
    const s = P;
    super(t, e, i, r, o), this[s(350)] = { a: { x: 0, y: 0 }, z: { x: 0, y: 0 } };
  }
  [P(354)]() {
    const t = P;
    let e = this.inLinks, i = this.outLinks;
    const r = this;
    let o = 0, s = 0;
    e.length > 0 && (o = ze(r.inLinks[0].getBeginPoint(), r)), i.length > 0 && (s = ze(r.outLinks[0].getEndPoint(), r));
    let l = Math.min(this.width / 2, this.height / 2);
    this._drawData.a = { x: Math.cos(o) / 1.618 * l, y: Math.sin(o) / 1.618 * l }, this._drawData.z = { x: Math[t(339)](s) / 1.618 * l, y: Math[t(356)](s) / 1.618 * l };
  }
  [P(359)](t) {
    const e = P;
    t[e(342)] = e(345), t.lineCap = "square", t.lineWidth = 20, this._beforDraw();
    let i = this[e(350)].a, r = this._drawData.z;
    t.beginPath(), t.moveTo(i.x, i.y), t.lineTo(i.x / 1.618, i.y / 1.618), t.quadraticCurveTo(0, 0, r.x / 1.618, r.y / 1.618), t[e(340)](r.x, r.y), t.stroke();
  }
}
function ze(n, t) {
  let e = n.x - t.x, i = n.y - t.y;
  return Math.atan2(i, e);
}
function ee() {
  const n = ["defineProperty", "8uYBdKM", "_beforDraw", "JointLNode", "sin", "2785358EoWCur", "1QHqSUR", "draw", "12MvUnFU", "prototype", "2132530sTGChV", "cos", "lineTo", "16965936lztupj", "strokeStyle", "8TzSXap", "11ZAsimO", "blue", "1364073fswSMr", "8794926lPzqCU", "1784010mQVimO", "45288948NgzCAP", "_drawData", "regClass"];
  return (ee = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? ln(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && an(t, e, o);
})([q(P(355))], Ne[P(361)], "className", 2), z[P(351)]("com.jtopo.extensions", P(355), Ne);
const hn = U;
(function() {
  const n = U, t = ne();
  for (; ; )
    try {
      if (-parseInt(n(333)) / 1 + -parseInt(n(337)) / 2 * (parseInt(n(343)) / 3) + -parseInt(n(325)) / 4 + parseInt(n(338)) / 5 * (parseInt(n(342)) / 6) + parseInt(n(319)) / 7 + parseInt(n(336)) / 8 + -parseInt(n(328)) / 9 * (parseInt(n(322)) / 10) === 927012)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var cn = Object.defineProperty, un = Object.getOwnPropertyDescriptor;
function U(n, t) {
  const e = ne();
  return (U = function(i, r) {
    return e[i -= 317];
  })(n, t);
}
class Be extends Jt {
  constructor(t, e = 0, i = 0, r = 1, o = 1) {
    const s = U;
    super(t, e, i, r, o), this[s(317)] = { arrowNumbers: 5, blinkFrequency: 1e3 }, this[s(330)] = {};
  }
  ae(t) {
    Object[U(334)](this.aeOptions, t);
  }
  setupAE() {
    const t = U;
    let e = [];
    this.aeStatus[t(323)] = e;
    let i = this[t(317)].arrowNumbers;
    for (let s = 0; s < i; s++)
      e.push(0.5);
    let r = this, o = new N();
    o.name = "BlinkingArrow", o.setAttributes({ from: 0, to: i, duration: r[t(317)].blinkFrequency, times: 1 / 0, update: (s) => {
      const l = t;
      let a = Math[l(321)](s);
      a > i || (a > 0 && (e[a - 1] = 0.5), a == 0 && (e[e[l(318)] - 1] = 0.5), e[a] = 1, r.update());
    } }), this[t(335)][t(320)](o);
  }
  draw(t) {
    const e = U;
    let i = this.width, r = this.height, o = this.getComputedStyle();
    o.applyTo(t);
    let s = o.borderWidth || 0, l = o.padding || 0, a = 0.5 * -i + s + l, h = (i - (2 * l + 2 * s)) / this[e(317)].arrowNumbers, c = this.aeStatus.alphas;
    for (let u = 0; u < this.aeOptions[e(341)]; u++)
      t.save(), t[e(331)](), c[u] == 1 && (t[e(327)] = 2, t.shadowOffsetX = 2, t.shadowColor = o.strokeStyle || "gray", t.lineWidth = 0.5 * o[e(332)] + 0.5 * c[u] * o[e(332)], t.shadowBlur = 13 * c[u]), t.globalAlpha = c[u], t[e(340)](a + h * u, 0.5 * -r), t.lineTo(a + h * u + 0.5 * h, 0), t[e(324)](a + h * u, 0.5 * r), t[e(326)](), t[e(329)]();
    this._paintText(t);
  }
  destroy() {
    super.destroy(), this.aeStatus = null;
  }
}
function ne() {
  const n = ["3jZEeQJ", "aeOptions", "length", "11074308TyazSJ", "push", "round", "393710bHzxpO", "alphas", "lineTo", "4304776uNWbpp", "stroke", "shadowOffsetY", "81iMobWZ", "restore", "aeStatus", "beginPath", "lineWidth", "1556504MReOJH", "assign", "animations", "12214376xcroYY", "492454iqLuiX", "5257175bXNpWP", "BlinkingArrowNode", "moveTo", "arrowNumbers", "6qtUnBZ"];
  return (ne = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? un(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && cn(t, e, o);
})([q("BlinkingArrowNode")], Be.prototype, "className", 2), z.regClass("com.jtopo.extensions", hn(339), Be);
const M = it;
function it(n, t) {
  const e = ie();
  return (it = function(i, r) {
    return e[i -= 318];
  })(n, t);
}
(function() {
  const n = it, t = ie();
  for (; ; )
    try {
      if (parseInt(n(343)) / 1 * (parseInt(n(334)) / 2) + -parseInt(n(344)) / 3 * (parseInt(n(336)) / 4) + parseInt(n(348)) / 5 * (parseInt(n(326)) / 6) + -parseInt(n(342)) / 7 * (parseInt(n(324)) / 8) + parseInt(n(340)) / 9 + -parseInt(n(347)) / 10 + -parseInt(n(325)) / 11 * (parseInt(n(330)) / 12) === 851590)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var pn = Object.defineProperty, dn = Object.getOwnPropertyDescriptor;
function ie() {
  const n = ["aeOptions", "RipplingNode", "globalAlpha", "aeStatus", "_onAEChanged", "className", "lineWidth", "1160376DgbxYO", "22OHMdOA", "6441516EvAIvM", "ellipse", "_width", "length", "3789204CHPnXh", "circleNumber", "beginPath", "circles", "2fYGrer", "prototype", "4lQjvht", "radiusDx", "radiusMax", "animations", "814959gwkBhp", "width", "14YqpDBa", "918338QTnOPz", "813315cpFHfm", "_afterStyleComputed", "stroke", "381520meswBm", "5TXMOAw"];
  return (ie = function() {
    return n;
  })();
}
class De extends Jt {
  constructor(t, e = 0, i = 0, r = 50, o = 50) {
    const s = it;
    super(t, e, i, r, o), this[s(349)] = { circleNumber: 2 }, this[s(320)] = { circles: [], radiusMax: 1, radiusDx: 0, circleNumber: 0, lineWidthMax: 6 };
  }
  ae(t) {
    const e = it;
    Object.assign(this[e(349)], t), this[e(321)]();
  }
  [M(321)]() {
    const t = M;
    let e = this[t(320)], i = this.aeOptions, r = 0.5 * Math.min(this.width, this.height), o = i.circleNumber || 5;
    if (e.circleNumber !== o) {
      e.circleNumber = o;
      const s = [];
      for (let l = 0; l < e[t(331)]; l++)
        s.push({ radius: 0, lineWidth: 0, globalAlpha: 0 });
      e[t(333)] = s;
    }
    e.radiusMax !== r && this.animations && this[t(339)].forEach((s) => {
      s.to = [e.radiusMax];
    }), e.radiusMax = r, e.radiusDx = e.radiusMax / o;
  }
  [M(345)]() {
    const t = M;
    super[t(345)](), this[t(320)].lineWidthMax = this.getComputedStyle().lineWidth || 6;
  }
  setupAE() {
    const t = M;
    let e = this.aeStatus;
    this._onAEChanged();
    let i = new N({ object: this, name: "Rippling", from: [1], to: [e[t(338)]], update: (r) => {
      const o = t;
      let s = e.circles, l = Math.max(r[0], 0);
      for (let a = 0; a < s.length; a++) {
        let h = s[a], c = l + a * e[o(337)];
        c > e[o(338)] && (c %= e[o(338)]);
        let u = c / e[o(338)];
        h.radius = c, h[o(323)] = u * e.lineWidthMax, h.globalAlpha = 1 - Math.min(1, c / e[o(338)]);
      }
    }, times: 1 / 0, duration: 2e3 });
    this.animations.push(i);
  }
  set width(t) {
    const e = M;
    super.width = t, this[e(321)]();
  }
  get [M(341)]() {
    return this[M(328)];
  }
  set height(t) {
    const e = M;
    super.height = t, this[e(321)]();
  }
  get height() {
    return this._height;
  }
  draw(t) {
    const e = M;
    let i = this.aeStatus[e(333)], r = this.getComputedStyle();
    t.strokeStyle = r.strokeStyle;
    for (let o = 0; o < i[e(329)]; o++) {
      let s = i[o];
      t[e(332)](), t[e(323)] = s.lineWidth, t[e(319)] = s[e(319)], t[e(327)](0, 0, s.radius, s.radius, 0, 0, 2 * Math.PI), t[e(346)]();
    }
  }
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? dn(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && pn(t, e, o);
})([q(M(318))], De[M(335)], M(322), 2), z.regClass("com.jtopo.extensions", "RipplingNode", De);
const T = G;
(function() {
  const n = G, t = se();
  for (; ; )
    try {
      if (parseInt(n(424)) / 1 * (parseInt(n(453)) / 2) + -parseInt(n(433)) / 3 * (parseInt(n(429)) / 4) + parseInt(n(455)) / 5 + -parseInt(n(452)) / 6 + -parseInt(n(431)) / 7 + -parseInt(n(445)) / 8 * (-parseInt(n(442)) / 9) + -parseInt(n(443)) / 10 === 500110)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var fn = Object.defineProperty, mn = Object.getOwnPropertyDescriptor;
function G(n, t) {
  const e = se();
  return (G = function(i, r) {
    return e[i -= 424];
  })(n, t);
}
class We extends Jt {
  constructor(t, e = 0, i = 0, r = 1, o = 1) {
    const s = G;
    super(t, e, i, r, o), this[s(430)] = { capacity: 0.5, waveHeight: 10 }, this.aeStatus = { leftPoints: [], rightPoints: [], capacity: 0, width: -1, height: -1, waveHeight: 0 }, this.setStyle(s(457), "#43b1f5");
  }
  ae(t) {
    Object.assign(this.aeOptions, t), this._onAEChanged();
  }
  _afterStyleComputed() {
    super[G(432)](), this._onAEChanged();
  }
  _updateWaveline() {
    const t = G, e = this.aeStatus;
    let i = e.leftPoints, r = e.rightPoints, o = e.height * (1 - e[t(425)]) - 0.5 * e.height;
    i[0].y = o, i[1].y = o + e.waveHeight, i[2].y = o - e.waveHeight, i[3].y = o, r[0].y = i[0].y, r[1].y = i[1].y, r[2].y = i[2].y, r[3].y = i[3].y;
  }
  [T(440)]() {
    const t = T, e = this[t(450)], i = this._getShapeSize(), r = this.aeOptions[t(441)] == null ? 10 : this.aeOptions[t(441)], o = this.aeOptions[t(425)] == null ? 0.5 : this[t(430)].capacity;
    if (e[t(449)] !== i[t(449)] || e[t(435)] !== i.height) {
      this._updateShapeSize();
      let s = this._getShapeSize().width, l = -s / 2, a = [{ x: l, y: 0 }, { x: l + s / 4, y: 0 }, { x: l + s - s / 4, y: 0 }, { x: l + s, y: 0 }], h = a[t(456)]((c) => ({ x: c.x + s, y: c.y }));
      e.leftPoints = a, e.rightPoints = h;
    }
    e.waveHeight = r, e[t(449)] = i.width, e.height = i.height, e.capacity = o, this._updateWaveline();
  }
  setupAE() {
    const t = T, e = this[t(450)];
    let i = new N({ name: "WaterLike", from: 0, to: 1, duration: 1500, times: 1 / 0, update: (r) => {
      const o = t;
      let s = e.width, l = 0.01 * s, a = 0.5 * s, h = e[o(434)], c = e.rightPoints;
      c[0].x >= a && (c[0].x = -a - s, c[1].x = c[0].x + s / 4, c[3].x = c[0].x + s, c[2].x = c[3].x - s / 4), h[0].x >= a && (h[0].x = -a - s, h[1].x = h[0].x + s / 4, h[3].x = h[0].x + s, h[2].x = h[3].x - s / 4), h.forEach((u, f) => {
        u.x += l;
      }), c.forEach((u, f) => {
        u.x += l;
      });
    } });
    this._onAEChanged(), this[t(462)].push(i);
  }
  [T(461)](t) {
    const e = T;
    let i = this._getShapeSize(), r = i[e(449)], o = i.height, s = this[e(439)]();
    s[e(437)](t);
    let l = s.lineWidth, a = 0.5 * -r, h = 0.5 * -o;
    t.beginPath(), s.borderRadius != null ? t.roundRect(a, h, r, o, s.borderRadius) : t.rect(a, h, r, o), t[e(454)](), l != 0 && t.stroke();
    {
      t.save();
      let c = 0.5 * l;
      t.beginPath(), s.borderRadius != null ? t.roundRect(a + c, h + c, r - l, o - l, s[e(448)]) : t.rect(a + c, h + c, r - l, o - l), t.closePath(), l != 0 && (t.lineWidth = 2 * l, t.strokeStyle = e(458), t[e(427)]()), t.clip();
      let u = this.aeStatus.leftPoints, f = this.aeStatus.rightPoints;
      if (t[e(460)](), u[0].x >= f[0].x) {
        let p = u;
        u = f, f = p;
      }
      t.moveTo(u[0].x, u[0].y), t.bezierCurveTo(u[1].x, u[1].y, u[2].x, u[2].y, u[3].x, u[3].y), t[e(444)](f[1].x, f[1].y, f[2].x, f[2].y, f[3].x, f[3].y), t.lineTo(f[3].x, -h), t[e(438)](u[0].x, -h), t.lineTo(u[0].x, u[0].y), t.closePath(), t.fillStyle = s[e(457)] || e(451), t[e(446)](), t[e(426)]();
    }
    s.color && (t.fillStyle = s.color), this._paintText(t);
  }
  set width(t) {
    super.width = t, this._onAEChanged();
  }
  get width() {
    return this[T(436)];
  }
  set height(t) {
    super.height = t, this._onAEChanged();
  }
  get [T(435)]() {
    return this._height;
  }
  [T(459)]() {
    super[T(459)](), this.aeStatus = null;
  }
}
function se() {
  const n = ["draw", "animations", "71HLusnQ", "capacity", "restore", "stroke", "WaterLikeNode", "57524tjSnwz", "aeOptions", "3441802RZBgQc", "_afterStyleComputed", "186IPWMIp", "leftPoints", "height", "_width", "applyTo", "lineTo", "getComputedStyle", "_onAEChanged", "waveHeight", "9fVMome", "714770sjsUec", "bezierCurveTo", "4798616CVTqSP", "fill", "regClass", "borderRadius", "width", "aeStatus", "#43b1f5", "1862658HFAyel", "24132WbHZqR", "closePath", "4044125DNcDTm", "map", "fillStyle", "rgba(0,0,0,0)", "destroy", "beginPath"];
  return (se = function() {
    return n;
  })();
}
function re() {
  const n = ["domChildrenToJson", "stroke-linecap", "5gXXCPu", "11feDZZo", "sweep-flag", "textToElement", "background", "connections", "3403520Zobksa", "arcsize", "limit", "276808WFHYqu", "path", "4910274SHTRKq", "length", "3SNZYlC", "256930HACpBo", "x-axis-rotation", "documentElement", "244702iINSPO", "getAttribute", "189OPShXE", "tagName", "24115788lGvCSw", "1491045uMDlmn", "name", "108gkTaGx"];
  return (re = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? mn(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && fn(t, e, o);
})([q("WaterLikeNode")], We.prototype, "className", 2), z[T(447)]("com.jtopo.extensions", T(428), We);
const J = oe;
function oe(n, t) {
  const e = re();
  return (oe = function(i, r) {
    return e[i -= 225];
  })(n, t);
}
(function() {
  const n = oe, t = re();
  for (; ; )
    try {
      if (parseInt(n(249)) / 1 * (parseInt(n(226)) / 2) + parseInt(n(231)) / 3 + parseInt(n(242)) / 4 * (-parseInt(n(236)) / 5) + -parseInt(n(247)) / 6 + -parseInt(n(228)) / 7 * (parseInt(n(245)) / 8) + parseInt(n(233)) / 9 * (parseInt(n(250)) / 10) + parseInt(n(237)) / 11 * (parseInt(n(230)) / 12) === 578547)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class gn {
  constructor(t) {
    this.documentElement = this.textToElement(t);
  }
  [J(239)](t) {
    return new DOMParser().parseFromString(t, "text/xml").documentElement;
  }
  toJson() {
    const t = J, e = this[t(225)];
    let i = e.children, r = e[t(227)](t(232));
    if (r == null)
      throw new Error("category is null");
    let o = [], s = { package: r, shapes: o };
    for (let l = 0; l < i.length; l++) {
      let a = i[l], h = a[t(227)]("name"), c = parseFloat(a[t(227)]("w")), u = parseFloat(a.getAttribute("h")), f = [], p = a.getElementsByTagName("connections")[0];
      p != null && (f = this.domChildrenToJson(p, 1, 1));
      let d = this.parse(a.getElementsByTagName(t(240))[0], c, u), m = this.parse(a.getElementsByTagName("foreground")[0], c, u), x = { className: h, width: c, height: u };
      f.length > 0 && (x[t(241)] = f), d[t(248)] > 0 && (x.background = d), m[t(248)] > 0 && (x.foreground = m), o.push(x);
    }
    return s;
  }
  [J(234)](t, e, i) {
    let r = t.children, o = [];
    for (let s = 0; s < r.length; s++) {
      let l = this.domToJson(r[s], e, i);
      o.push(l);
    }
    return o;
  }
  domToJson(t, e, i) {
    const r = J;
    let o = { T: t.tagName }, s = t.attributes;
    for (let l = 0; l < s.length; l++) {
      let a = s[l], h = a.name, c = a.value;
      (h == "x" || h == "y" || h == "arcsize" || h == "w" || h == "h" || h == "x1" || h == "y1" || h == "x2" || h == "y2" || h == "x3" || h == "y3" || h == "cx" || h == "cy" || h == r(244) || h == "fontsize" || h == r(251) || h == "large-arc-flag" || h == r(238) || h == "r" || h == "rx" || h == "ry" || h == "stroke-width" || h == "stroke-dasharray" || h == "stroke-dashoffset" || h == r(235) || h == "stroke-linejoin" || h == "stroke-miterlimit" || h == "stroke-opacity" || h == "stroke-width" || h == "stroke-dasharray") && (c = parseFloat(c)), o[h] = c;
    }
    return this.unitCmd(o, e, i), o;
  }
  parse(t, e, i) {
    const r = J;
    let o = [];
    if (t == null)
      return [];
    let s = t.children;
    for (let l = 0; l < s.length; l++) {
      let a = s[l];
      if (a[r(229)] == "path") {
        let h = this.domChildrenToJson(a, e, i);
        o.push({ T: r(246), m: h });
      } else
        o.push(this.domToJson(a, e, i));
    }
    return o;
  }
  unitCmd(t, e, i) {
    const r = J;
    t.x != null && (t.x = t.x / e), t.y != null && (t.y = t.y / i), t.x1 != null && (t.x1 = t.x1 / e), t.y1 != null && (t.y1 = t.y1 / i), t.x2 != null && (t.x2 = t.x2 / e), t.y2 != null && (t.y2 = t.y2 / i), t.x3 != null && (t.x3 = t.x3 / e), t.y3 != null && (t.y3 = t.y3 / i), t.rx != null && (t.rx = t.rx / e), t.ry != null && (t.ry = t.ry / i), t.w != null && (t.w = t.w / e), t.h != null && (t.h = t.h / i), t.r != null && (t.r = t.r / Math.max(e, i)), t[r(243)] != null && (t.arcsize = t.arcsize / Math.max(e, i));
  }
}
function ae(n, t) {
  const e = le();
  return (ae = function(i, r) {
    return e[i -= 343];
  })(n, t);
}
const Ht = ae;
(function() {
  const n = ae, t = le();
  for (; ; )
    try {
      if (-parseInt(n(405)) / 1 + -parseInt(n(392)) / 2 * (-parseInt(n(350)) / 3) + parseInt(n(380)) / 4 * (-parseInt(n(373)) / 5) + parseInt(n(390)) / 6 + -parseInt(n(389)) / 7 * (parseInt(n(382)) / 8) + parseInt(n(381)) / 9 * (parseInt(n(401)) / 10) + -parseInt(n(378)) / 11 * (parseInt(n(367)) / 12) === 575641)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class yn {
  constructor() {
  }
  [Ht(344)](t, e, i) {
    const r = Ht;
    let o = "", s = !1;
    for (let l = 0; l < t[r(395)]; l++) {
      let a = t[l], h = a.T;
      h == "move" ? o += "M" + a.x * e + " " + a.y * i : h == "line" ? o += "L" + a.x * e + " " + a.y * i : h == r(370) ? o += "A" + a.rx * e + " " + a.ry * i + " " + a["x-axis-rotation"] + " " + a["large-arc-flag"] + " " + a["sweep-flag"] + " " + a.x * e + " " + a.y * i : h == r(393) ? o += "C" + a.x1 * e + " " + a.y1 * i + " " + a.x2 * e + " " + a.y2 * i + " " + a.x3 * e + " " + a.y3 * i : h == "close" && (o += "Z", s = !0);
    }
    return { isClosed: s, pathStr: o };
  }
  drawPathArray(t, e, i = 1, r = 1, o = 1) {
    const s = Ht;
    let l, a = null, h = null, c = i, u = r;
    for (let f = 0; f < e.length; f++) {
      let p = e[f], d = p.T;
      if (d == s(375)) {
        let m = this[s(344)](p.m, c, u);
        l = new Path2D(m[s(379)]), m.isClosed && l[s(403)]();
      } else if (d == "move")
        a = p.x, h = p.y, t.moveTo(p.x * c, p.y * u);
      else if (d == "close")
        t.closePath();
      else if (d == "line")
        a = p.x, h = p.y, t.lineTo(p.x * c, p.y * u);
      else if (d == "rect")
        t.beginPath(), p.x == null || t.rect(p.x * c, p.y * u, p.w * c, p.h * u);
      else if (d == s(372))
        t.beginPath(), p.x == null || t.roundRect(p.x * c, p.y * u, p.w * c, p.h * u, p[s(362)] * Math.max(c, u));
      else if (d == s(365))
        t.beginPath(), t[s(370)](p.cx * c, p.cy * u, p.r * Math.max(c, u), 0, 2 * Math.PI);
      else if (d == "ellipse")
        t.beginPath(), t.ellipse((p.x + p.w / 2) * c, (p.y + p.h / 2) * u, p.w / 2 * c, p.h / 2 * u, 0, 0, 2 * Math.PI);
      else if (d == "arc") {
        let m = "M" + a * c + " " + h * u + " A" + p.rx * c + " " + p.ry * u + " " + p[s(348)] + " " + p["large-arc-flag"] + " " + p[s(363)] + " " + p.x * c + " " + p.y * u, x = new Path2D(m);
        o > 0 && t[s(346)](x), a = p.x, h = p.y;
      } else
        d == s(393) ? t.bezierCurveTo(p.x1 * c, p.y1 * u, p.x2 * c, p.y2 * u, p.x3 * c, p.y3 * u) : d == "text" ? (t.textAlign = p.align, t[s(356)] = p.valign, t.fillText(p[s(368)], p.x * c, p.y * u)) : d == s(402) ? t.font = "normal " + p.size + "px sans-serif" : d == "fontcolor" ? t.fillStyle = p.color : d == "miterlimit" ? t.miterLimit = p[s(361)] : d == "linecap" ? t.lineCap = p.cap : d == "linejoin" ? t.linejoin = p.join : d == "stroke" ? l != null ? (o > 0 && t.stroke(l), l = null) : o > 0 && t.stroke() : d == "fill" ? l != null ? (t.fill(l), l = null) : t.fill() : d == "strokewidth" ? t.lineWidth = p.width : d == s(400) ? l != null ? (t.fill(l), o > 0 && t.stroke(l), l = null) : (t.fill(), o > 0 && t.stroke()) : d == "strokecolor" ? t[s(359)] = p.color : d == "fillcolor" ? t[s(377)] = p[s(351)] : d == s(391) ? t.save() : d == "restore" && t.restore();
    }
  }
}
function le() {
  const n = ["miterlimit", "ellipse", "rect", "fillstroke", "156670zVCCuD", "fontsize", "closePath", "ctx.beginPath();", "274104qrArRi", "ctx.closePath();", "lineWidth", "getPathInfo", '");', "stroke", "ctx.stroke();", "x-axis-rotation", "move", "28758vjUsuA", "color", "ctx.fillStyle = '", "max", "fontcolor", "ctx.lineTo(", "textBaseline", "ctx.strokeStyle = '", "ctx.miterLimit = '", "strokeStyle", "height", "limit", "arcsize", "sweep-flag", "ctx.stroke(path2D)", "circle", "join", "6048QJFnsn", "str", "ctx.moveTo(", "arc", "');", "roundrect", "2395hgoIRM", "restore", "path", "currPath.closePath();", "fillStyle", "726oLDPaX", "pathStr", "9528LZJLhz", "477UASvXC", "38264pKbYsx", ", 0, 0, 2 * Math.PI);", "push", "size", "fillcolor", 'ctx.font = "normal " + ', "line", "756UveXvj", "5487372vvfmNT", "save", "166qZSuEx", "curve", "ctx.fill(currPath);", "length", "ctx.textAlign = '"];
  return (le = function() {
    return n;
  })();
}
function he() {
  var n = ["279NIqVUi", "restore", "61014EQPgBy", "16664LUfAIW", "defineProperty", "2702765OMEmnB", "483bJCwkF", "3662316OaEcRy", "_pathArray", "XMLShape", "1798622kJzehG", "variable", "draw", "3227400IBZpIy", "907885DkxTnR"];
  return (he = function() {
    return n;
  })();
}
var tt = ce;
function ce(n, t) {
  var e = he();
  return (ce = function(i, r) {
    return e[i -= 206];
  })(n, t);
}
(function() {
  for (var n = ce, t = he(); ; )
    try {
      if (parseInt(n(220)) / 1 + -parseInt(n(216)) / 2 + parseInt(n(213)) / 3 + -parseInt(n(219)) / 4 + -parseInt(n(211)) / 5 + -parseInt(n(208)) / 6 * (-parseInt(n(212)) / 7) + parseInt(n(209)) / 8 * (parseInt(n(206)) / 9) === 648177)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var xn = Object[tt(210)], wn = Object.getOwnPropertyDescriptor;
const vn = new yn();
class Rt extends en {
  constructor() {
    var t = tt;
    super(), this.aspect = t(217);
  }
  [tt(218)](t, e) {
    var i = tt;
    if (this[i(214)] == null)
      return;
    let r = e.getComputedStyle().lineWidth, o = e._drawContentDesc.shapeSize, s = 0.5 * -o.width, l = 0.5 * -o.height;
    t.save(), t.translate(s, l), vn.drawPathArray(t, this[i(214)], o.width, o.height, r), t[i(207)]();
  }
}
function ue() {
  const n = ["540zLBRYN", "foreground", "3958670hjUkXu", "964895LPDQlD", "7cIBCAb", "24632wmRGlj", "background", "map", "width", "22554DhIRHg", "1420950GjPplp", "shapes", "35198PMEYpF", "8LtxKVU", "74GqVUhF", "height"];
  return (ue = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? wn(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && xn(t, e, o);
})([q("XMLShape")], Rt.prototype, "className", 2), z.regClass("com.jtopo.extensions", tt(215), Rt), function() {
  const n = wt, t = ue();
  for (; ; )
    try {
      if (-parseInt(n(513)) / 1 + -parseInt(n(515)) / 2 * (parseInt(n(510)) / 3) + -parseInt(n(514)) / 4 * (-parseInt(n(504)) / 5) + -parseInt(n(511)) / 6 + parseInt(n(505)) / 7 * (parseInt(n(506)) / 8) + -parseInt(n(501)) / 9 + parseInt(n(503)) / 10 === 234655)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
}();
const Fn = { fromXml: function(n) {
  const t = wt;
  let e = new gn(n).toJson();
  return e[t(512)][t(508)]((i) => {
    let r = function(o, s) {
      const l = wt;
      let a = new Rt();
      a[l(509)] = s.width, a[l(500)] = s[l(500)], a.namespace = o + "." + s.className;
      let h = [], c = s[l(507)];
      c && (h = h.concat(c));
      let u = s[l(502)];
      return u && (h = h.concat(u)), a._pathArray = h, s.connections && (s.connections.forEach((f) => {
        f.x = 2 * f.x - 1, f.y = 2 * f.y - 1, f.usage = f.usage || nn.CONNECT_EDIT;
      }), a.setConnections(s.connections)), a;
    }(e.package, i);
    return z.regShape(e.package, i.className, r), r;
  });
} };
function wt(n, t) {
  const e = ue();
  return (wt = function(i, r) {
    return e[i -= 500];
  })(n, t);
}
const R = pe;
(function() {
  const n = pe, t = de();
  for (; ; )
    try {
      if (-parseInt(n(214)) / 1 + parseInt(n(209)) / 2 * (-parseInt(n(201)) / 3) + -parseInt(n(193)) / 4 * (parseInt(n(207)) / 5) + parseInt(n(210)) / 6 * (-parseInt(n(197)) / 7) + parseInt(n(212)) / 8 + parseInt(n(195)) / 9 * (parseInt(n(206)) / 10) + -parseInt(n(205)) / 11 * (-parseInt(n(196)) / 12) === 602227)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var bn = Object.defineProperty, In = Object[R(208)];
class Ft extends qt {
  constructor(t, e = 0, i = 0, r = 1, o = 1) {
    super(t, e, i, r, o), this.setAttributes({ ratio: 0.5, direction: "right" });
  }
  drawShape(t) {
    const e = R;
    let i = this;
    const r = this.width, o = this.height;
    let s = i.getAttribute(e(213)), l = i[e(204)](e(194)), a = i.getComputedStyle();
    a.fillStyle && (t[e(215)] = a.fillStyle);
    let h = a.borderWidth || 0, c = a.padding || 0, u = 2 * c + 2 * h, f = 0.5 * -r + h + c, p = 0.5 * -o + h + c, d = (r - u) * s, m = (o - u) * s;
    if (l == "right")
      m = o - u;
    else if (l == "down")
      d = r - u;
    else if (l == e(202))
      f = 0.5 * -r + r - h - c - d, m = o - u;
    else {
      if (l != "up")
        throw new Error("Unknow direction:" + l);
      p = 0.5 * -o + o - h - c - m, d = r - u;
    }
    t[e(203)](), t.rect(f, p, d, m), t.fill();
  }
}
function pe(n, t) {
  const e = de();
  return (pe = function(i, r) {
    return e[i -= 193];
  })(n, t);
}
function de() {
  const n = ["prototype", "4210224HVtNjq", "ratio", "362126kxPKGi", "fillStyle", "41220Tvojyq", "direction", "3395943zJdqHy", "408288UCRico", "3743292caIYcG", "RatioNode", "defineProperties", "regClass", "129MpNQtq", "left", "beginPath", "getAttribute", "660nlCIOZ", "10KNKrty", "355KOouVS", "getOwnPropertyDescriptor", "8350FYJyLD", "12qbpxsl"];
  return (de = function() {
    return n;
  })();
}
function A(n, t) {
  var e = fe();
  return (A = function(i, r) {
    return e[i -= 142];
  })(n, t);
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? In(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && bn(t, e, o);
})([q(R(198))], Ft[R(211)], "className", 2), Object[R(199)](Ft.prototype, { ratio: { set(n) {
  this.setAttribute("ratio", n);
}, get() {
  return this.getAttribute("ratio");
} }, direction: { set(n) {
  this.setAttribute("direction", n);
}, get() {
  const n = R;
  return this.getAttribute(n(194));
} } }), z[R(200)]("com.jtopo.extensions", "RatioNode", Ft);
var kn = A;
function fe() {
  var n = ["Warning, gif stream shorter than expected.", "1984300RmPAWw", "match", "stoped", "delay", "args", "data_offset", "log", "29EoZuZQ", "href", "transparent_index", "totalFrames", "data", "imageData", "charCodeAt", "13488579YcHBbm", "toString", "26108GiiKIJ", "Invalid graphics extension block.", "11351123SbfrSw", "method", "play", "numFrames", "488JlIYkk", "46131ykUCZV", "disposal", "length", "framenum", "url", "7896EKtmVl", "width", "draw", "decodeAndBlitFrameRGBA", "9931290fnctYN", "5BBviuf", "then"];
  return (fe = function() {
    return n;
  })();
}
(function() {
  for (var n = A, t = fe(); ; )
    try {
      if (parseInt(n(145)) / 1 * (parseInt(n(154)) / 2) + -parseInt(n(161)) / 3 * (-parseInt(n(160)) / 4) + parseInt(n(171)) / 5 * (parseInt(n(170)) / 6) + -parseInt(n(156)) / 7 + parseInt(n(166)) / 8 + -parseInt(n(152)) / 9 + parseInt(n(174)) / 10 === 988872)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})(), (function() {
  const n = self, t = /* @__PURE__ */ new Map(), e = { load: function(s) {
    var l = A;
    const a = s.basePath, h = s.url;
    if (h.startsWith("data:image/gif")) {
      const c = h.split(",")[1], u = atob(c), f = new Uint8Array(u[l(163)]);
      for (let m = 0; m < u.length; m++)
        f[m] = u[l(151)](m);
      const p = f.buffer;
      let d = new r(h, p);
      t.set(h, d);
    } else
      fetch(new URL(s[l(165)], a)[l(146)])[l(172)]((c) => {
        if (!c.ok)
          throw new Error("HTTP status:" + c.status);
        return c.arrayBuffer();
      }).then((c) => {
        let u = new r(h, c);
        t.set(h, u);
      }).catch((c) => {
        i.call("onError", { url: h });
      });
  }, stop: function(s) {
    let l = t.get(s.url);
    l != null && l.stop();
  }, play: function(s) {
    var l = A;
    let a = t.get(s.url);
    a != null && a[l(158)]();
  } }, i = { call: function(s, l) {
    n.postMessage({ method: s, args: l, time: Date.now() });
  } };
  n.onmessage = function(s) {
    var l = A;
    let a = s.data[l(157)], h = s[l(149)][l(142)];
    e[a].call(e, h);
  };
  class r {
    constructor(l, a) {
      var h = A;
      this[h(148)] = 0, this[h(164)] = 0, this.stoped = !0, this[h(165)] = l;
      var c = new o(new Uint8Array(a));
      this[h(150)] = new Uint8ClampedArray(c.width * c.height * 4), this.totalFrames = c.numFrames(), this.gr = c, i.call("onLoad", { url: l, width: c[h(167)], height: c.height }), this.loopRender();
    }
    stop() {
      this[A(176)] = !0;
    }
    play() {
      this.stoped = !1;
    }
    loopRender() {
      var l = A;
      const a = this, h = this.gr;
      var c = this.framenum % this[l(148)], u = h.frameInfo(c);
      !this.stoped && ((c === 0 || u[l(162)] === 2) && this[l(150)].fill(0), h[l(169)](c, this.imageData), i.call(l(168), { url: this[l(165)], width: h[l(167)], height: h.height, pixes: this.imageData })), setTimeout(() => {
        a.loopRender(), a.framenum++;
      }, 10 * u[l(177)]);
    }
  }
  function o(s) {
    var l = A, a = 0;
    if (s[a++] !== 71 || s[a++] !== 73 || s[a++] !== 70 || s[a++] !== 56 || (s[a++] + 1 & 253) != 56 || s[a++] !== 97)
      throw new Error("Invalid GIF 87a/89a header.");
    var h = s[a++] | s[a++] << 8, c = s[a++] | s[a++] << 8, u = s[a++], f = u >> 7, p = 1 << (7 & u) + 1;
    s[a++], s[a++];
    var d = null, m = null;
    f && (d = a, m = p, a += 3 * p);
    var x = !0, v = [], S = 0, C = null, Ie = 0, ke = null;
    for (this.width = h, this.height = c; x && a < s.length; )
      switch (s[a++]) {
        case 33:
          switch (s[a++]) {
            case 255:
              if (s[a] !== 11 || s[a + 1] == 78 && s[a + 2] == 69 && s[a + 3] == 84 && s[a + 4] == 83 && s[a + 5] == 67 && s[a + 6] == 65 && s[a + 7] == 80 && s[a + 8] == 69 && s[a + 9] == 50 && s[a + 10] == 46 && s[a + 11] == 48 && s[a + 12] == 3 && s[a + 13] == 1 && s[a + 16] == 0)
                a += 14, ke = s[a++] | s[a++] << 8, a++;
              else
                for (a += 12; ; ) {
                  if (!((j = s[a++]) >= 0))
                    throw Error("Invalid block size");
                  if (j === 0)
                    break;
                  a += j;
                }
              break;
            case 249:
              if (s[a++] !== 4 || s[a + 4] !== 0)
                throw new Error(l(155));
              var Me = s[a++];
              S = s[a++] | s[a++] << 8, C = s[a++], 1 & Me || (C = null), Ie = Me >> 2 & 7, a++;
              break;
            case 1:
            case 254:
              for (; ; ) {
                if (!((j = s[a++]) >= 0))
                  throw Error("Invalid block size");
                if (j === 0)
                  break;
                a += j;
              }
              break;
            default:
              throw new Error("Unknown graphic control label: 0x" + s[a - 1][l(153)](16));
          }
          break;
        case 44:
          var Ue = s[a++] | s[a++] << 8, qe = s[a++] | s[a++] << 8, Ee = s[a++] | s[a++] << 8, Se = s[a++] | s[a++] << 8, kt = s[a++], Je = kt >> 6 & 1, Ce = 1 << (7 & kt) + 1, Te = d, Ae = m, Le = !1;
          kt >> 7 && (Le = !0, Te = a, Ae = Ce, a += 3 * Ce);
          var Pe = a;
          for (a++; ; ) {
            var j;
            if (!((j = s[a++]) >= 0))
              throw Error("Invalid block size");
            if (j === 0)
              break;
            a += j;
          }
          v.push({ x: Ue, y: qe, width: Ee, height: Se, has_local_palette: Le, palette_offset: Te, palette_size: Ae, data_offset: Pe, data_length: a - Pe, transparent_index: C, interlaced: !!Je, delay: S, disposal: Ie, pixelsArray: new Uint8Array(Ee * Se) });
          break;
        case 59:
          x = !1;
          break;
        default:
          throw new Error("Unknown gif block: 0x" + s[a - 1].toString(16));
      }
    this[l(159)] = function() {
      return v.length;
    }, this.loopCount = function() {
      return ke;
    }, this.frameInfo = function(Y) {
      if (Y < 0 || Y >= v.length)
        throw new Error("Frame index out of range.");
      return v[Y];
    }, this[l(169)] = function(Y, lt) {
      var Mt = l, k = this.frameInfo(Y), Ge = k[Mt(167)] * k.height, ht = k.pixelsArray;
      ht.fill(0), function(pt, dt, jt, Oe) {
        for (var Ot = A, _t = pt[dt++], Nt = 1 << _t, zt = Nt + 1, Z = zt + 1, D = _t + 1, V = (1 << D) - 1, X = 0, Bt = 0, K = 0, ft = pt[dt++], Dt = new Int32Array(4096), Q = null; ; ) {
          for (; X < 16 && ft !== 0; )
            Bt |= pt[dt++] << X, X += 8, ft === 1 ? ft = pt[dt++] : --ft;
          if (X < D)
            break;
          var W = Bt & V;
          if (Bt >>= D, X -= D, W !== Nt) {
            if (W === zt)
              break;
            for (var mt = W < Z ? W : Q, gt = 0, O = mt; O > Nt; )
              O = Dt[O] >> 8, ++gt;
            var Wt = O;
            if (K + gt + (mt !== W ? 1 : 0) > Oe)
              return void console[Ot(144)]("Warning, gif stream longer than expected.");
            jt[K++] = Wt;
            var Qe = K += gt;
            for (mt !== W && (jt[K++] = Wt), O = mt; gt--; )
              O = Dt[O], jt[--Qe] = 255 & O, O >>= 8;
            Q !== null && Z < 4096 && (Dt[Z++] = Q << 8 | Wt, Z >= V + 1 && D < 12 && (++D, V = V << 1 | 1)), Q = W;
          } else
            Z = zt + 1, V = (1 << (D = _t + 1)) - 1, Q = null;
        }
        K !== Oe && console[Ot(144)](Ot(173));
      }(s, k[Mt(143)], ht, Ge);
      var Et = k.palette_offset, St = k[Mt(147)];
      St === null && (St = 256);
      var ct = k.width, Ct = h - ct, Tt = ct, je = 4 * (k.y * h + k.x), Ye = 4 * ((k.y + k.height) * h + k.x), B = je, At = 4 * Ct;
      k.interlaced === !0 && (At += 4 * h * 7);
      for (var Lt = 8, Pt = 0, Ze = ht.length; Pt < Ze; ++Pt) {
        var ut = ht[Pt];
        if (Tt === 0 && (Tt = ct, (B += At) >= Ye && (At = 4 * Ct + 4 * h * (Lt - 1), B = je + (ct + Ct) * (Lt << 1), Lt >>= 1)), ut === St)
          B += 4;
        else {
          var Ve = s[Et + 3 * ut], Xe = s[Et + 3 * ut + 1], Ke = s[Et + 3 * ut + 2];
          lt[B++] = Ve, lt[B++] = Xe, lt[B++] = Ke, lt[B++] = 255;
        }
        --Tt;
      }
    };
  }
}).toString()[kn(175)](/\{([\s\S]*?)\}$/);
const yt = _;
function me() {
  const n = ["postMessage", "24PopfZY", "load", "644190iDHKGR", "44VMPdvc", "14128530YpWKgW", "time", "imageSrc", "url", "12478304vTemgt", "size", "height", "update", "ctx", "init", "worker", "stop", "63fYEfue", "set", "1619540ynTNBn", "createElement", "onDraw", "delete", "107150AAcGAY", "pixes", "327KwChZs", "putImageData", "14042SBjdYv", "509399zrCRbm", "canvas", "get", "data", "9Pmefgb", "width", "nodeSetMap", "getContext"];
  return (me = function() {
    return n;
  })();
}
function _(n, t) {
  const e = me();
  return (_ = function(i, r) {
    return e[i -= 422];
  })(n, t);
}
(function() {
  const n = _, t = me();
  for (; ; )
    try {
      if (-parseInt(n(425)) / 1 + parseInt(n(433)) / 2 * (parseInt(n(431)) / 3) + -parseInt(n(446)) / 4 * (parseInt(n(429)) / 5) + parseInt(n(445)) / 6 * (-parseInt(n(423)) / 7) + parseInt(n(451)) / 8 + -parseInt(n(438)) / 9 * (-parseInt(n(447)) / 10) + -parseInt(n(434)) / 11 * (parseInt(n(443)) / 12) === 823757)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Mn extends ot {
  constructor() {
    const t = _;
    super(), this.canvasCache = /* @__PURE__ */ new Map(), this.nodeSetMap = /* @__PURE__ */ new Map(), this[t(456)]();
  }
  getCanvas(t) {
    let e = this.canvasCache.get(t.imageSrc);
    return e == null ? null : e.canvas;
  }
  addNode(t) {
    const e = _;
    let i = t[e(449)], r = "play", o = this[e(440)][e(436)](i);
    o == null && (o = /* @__PURE__ */ new Set(), this.nodeSetMap.set(i, o), r = "load"), o.add(t), r == e(444) ? this.worker.postMessage({ method: r, args: { url: i, basePath: location.href } }) : this.play(i);
  }
  hasNode(t) {
    const e = _;
    let i = this.nodeSetMap[e(436)](t[e(449)]);
    return i != null && i.has(t);
  }
  removeNode(t) {
    const e = _;
    let i = t[e(449)], r = this.nodeSetMap.get(i);
    r != null && r[e(452)] != 0 && (r[e(428)](t), r[e(452)] == 0 && this.stop(i));
  }
  play(t) {
    const e = _;
    this.worker[e(442)]({ method: "play", args: { url: t } });
  }
  [yt(422)](t) {
    const e = yt;
    this[e(457)][e(442)]({ method: "stop", args: { url: t } });
  }
  onDraw(t) {
    const e = yt;
    let i = this.nodeSetMap[e(436)](t);
    if (i != null && i[e(452)] != 0)
      for (let r of i)
        r[e(454)]();
  }
  init() {
    const t = yt, e = this, i = new Blob(['function o(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,a=t[e++]|t[e++]<<8,n=t[e++],i=n>>7,l=1<<1+(7&n);t[e++],t[e++];var o=null,s=null;i&&(o=e,s=l,e+=3*l);var h=!0,f=[],d=0,c=null,u=0,g=null;for(this.width=r,this.height=a;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,g=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var w=t[e++];d=t[e++]|t[e++]<<8,c=t[e++],1&w||(c=null),u=w>>2&7,e++;break;case 1:case 254:for(;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var p=t[e++]|t[e++]<<8,m=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,k=t[e++],y=k>>6&1,x=1<<1+(7&k),A=o,E=s,I=!1;k>>7&&(I=!0,A=e,E=x,e+=3*x);var _=e;for(e++;;){var F;if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}f.push({x:p,y:m,width:v,height:b,has_local_palette:I,palette_offset:A,palette_size:E,data_offset:_,data_length:e-_,transparent_index:c,interlaced:!!y,delay:d,disposal:u,pixelsArray:new Uint8Array(v*b)});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return g},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameRGBA=function(e,a){var n=this.frameInfo(e),i=n.width*n.height,l=n.pixelsArray;l.fill(0),function(t,e,r,a){for(var n=t[e++],i=1<<n,l=i+1,o=l+1,s=n+1,h=(1<<s)-1,f=0,d=0,c=0,u=t[e++],g=new Int32Array(4096),w=null;;){for(;f<16&&0!==u;)d|=t[e++]<<f,f+=8,1===u?u=t[e++]:--u;if(f<s)break;var p=d&h;if(d>>=s,f-=s,p!==i){if(p===l)break;for(var m=p<o?p:w,v=0,b=m;b>i;)b=g[b]>>8,++v;var k=b;if(c+v+(m!==p?1:0)>a)return void console.log("Warning, gif stream longer than expected.");r[c++]=k;var y=c+=v;for(m!==p&&(r[c++]=k),b=m;v--;)b=g[b],r[--y]=255&b,b>>=8;null!==w&&o<4096&&(g[o++]=w<<8|k,o>=h+1&&s<12&&(++s,h=h<<1|1)),w=p}else o=l+1,h=(1<<(s=n+1))-1,w=null}c!==a&&console.log("Warning, gif stream shorter than expected.")}(t,n.data_offset,l,i);var o=n.palette_offset,s=n.transparent_index;null===s&&(s=256);var h=n.width,f=r-h,d=h,c=4*(n.y*r+n.x),u=4*((n.y+n.height)*r+n.x),g=c,w=4*f;!0===n.interlaced&&(w+=4*r*7);for(var p=8,m=0,v=l.length;m<v;++m){var b=l[m];if(0===d&&(d=h,(g+=w)>=u&&(w=4*f+4*r*(p-1),g=c+(h+f)*(p<<1),p>>=1)),b===s)g+=4;else{var k=t[o+3*b],y=t[o+3*b+1],x=t[o+3*b+2];a[g++]=k,a[g++]=y,a[g++]=x,a[g++]=255}--d}}}const l=self,e=new Map,i={load:function(t){const r=t.basePath,i=t.url;if(i.startsWith("data:image/gif")){const t=i.split(",")[1],r=atob(t),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);const l=n.buffer;let o=new a(i,l);e.set(i,o)}else fetch(new URL(t.url,r).href).then(t=>{if(!t.ok)throw new Error("HTTP status:"+t.status);return t.arrayBuffer()}).then(t=>{let r=new a(i,t);e.set(i,r)}).catch(t=>{n.call("onError",{url:i})})},stop:function(t){let r=e.get(t.url);null!=r&&r.stop()},play:function(t){let r=e.get(t.url);null!=r&&r.play()}},n={call:function(t,e){l.postMessage({method:t,args:e,time:Date.now()})}};l.onmessage=function(t){let e=t.data.method,r=t.data.args;i[e].call(i,r)};class a{constructor(t,e){this.totalFrames=0,this.framenum=0,this.stoped=!0,this.url=t;var r=new o(new Uint8Array(e));this.imageData=new Uint8ClampedArray(r.width*r.height*4),this.totalFrames=r.numFrames(),this.gr=r,n.call("onLoad",{url:t,width:r.width,height:r.height}),this.loopRender()}stop(){this.stoped=!0}play(){this.stoped=!1}loopRender(){const t=this,e=this.gr;var r=this.framenum%this.totalFrames,a=e.frameInfo(r);this.stoped||(0!==r&&2!==a.disposal||this.imageData.fill(0),e.decodeAndBlitFrameRGBA(r,this.imageData),n.call("draw",{url:this.url,width:e.width,height:e.height,pixes:this.imageData})),setTimeout(()=>{t.loopRender(),t.framenum++},10*a.delay)}}'], { type: "application/javascript" }), r = new Worker(URL.createObjectURL(i));
    this[t(457)] = r;
    const o = this.canvasCache, s = { onLoad(l) {
      const a = t;
      let h = new ImageData(l[a(439)], l[a(453)]), c = document[a(426)](a(435));
      c.width = l.width, c[a(453)] = l.height;
      let u = c[a(441)]("2d"), f = { canvas: c, ctx: u, imageData: h };
      o[a(424)](l.url, f), e.play(l[a(450)]);
    }, draw(l) {
      const a = t;
      let h = o.get(l.url), c = h.imageData;
      c.data.set(l[a(430)]), h[a(455)][a(432)](c, 0, 0), e[a(427)](l.url);
    }, onError(l) {
    } };
    r.onmessage = function(l) {
      const a = t;
      let h = l[a(437)], c = h.method, u = h.args;
      h[a(448)], s[c].call(s, u);
    };
  }
}
const xt = new Mn();
var En = st;
function ge() {
  var n = ["removeNode", "2053272wFZezJ", "width", "getCanvas", "imageSrc", "279290eTnLVW", "height", "80380WHIUSn", "24tCLzFW", "3921416EXfVjb", "50466lQyYdd", "644854fbFcMB", "33gspAIk", "drawImage", "1312318mnMyVs", ".gif", "com.jtopo.extensions", "9bhQTaX", "306qSsErl", "addNode"];
  return (ge = function() {
    return n;
  })();
}
(function() {
  for (var n = st, t = ge(); ; )
    try {
      if (parseInt(n(455)) / 1 + parseInt(n(465)) / 2 + parseInt(n(454)) / 3 * (-parseInt(n(472)) / 4) + parseInt(n(471)) / 5 * (-parseInt(n(462)) / 6) + parseInt(n(458)) / 7 + -parseInt(n(473)) / 8 * (parseInt(n(461)) / 9) + parseInt(n(469)) / 10 * (parseInt(n(456)) / 11) === 531766)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var Sn = Object.defineProperty, Cn = Object.getOwnPropertyDescriptor;
function st(n, t) {
  var e = ge();
  return (st = function(i, r) {
    return e[i -= 454];
  })(n, t);
}
class He extends sn {
  constructor(t, e = 0, i = 0, r = 1, o = 1) {
    super(t, e, i, r, o);
  }
  _drawImage(t, e) {
    var i = st;
    if (xt.hasNode(this)) {
      let r = xt[i(467)](this);
      if (r != null)
        return void t[i(457)](r, 0.5 * -this.width, 0.5 * -this.height, this.width, this.height);
    } else
      this.imageObject != null && (this[i(468)].endsWith(i(459)) || this.imageSrc.startsWith("data:image/gif")) && xt[i(463)](this);
    t[i(457)](e, 0.5 * -this[i(466)], 0.5 * -this.height, this[i(466)], this[i(470)]);
  }
  removeFromParent() {
    var t = st;
    return super.removeFromParent(), xt[t(464)](this), this;
  }
}
((n, t, e, i) => {
  for (var r, o = i > 1 ? void 0 : i ? Cn(t, e) : t, s = n.length - 1; s >= 0; s--)
    (r = n[s]) && (o = (i ? r(t, e, o) : r(o)) || o);
  i && o && Sn(t, e, o);
})([q("GifNode")], He.prototype, "className", 2), z.regClass(En(460), "GifNode", He);
const g = ye;
(function() {
  const n = ye, t = xe();
  for (; ; )
    try {
      if (parseInt(n(328)) / 1 + parseInt(n(318)) / 2 + -parseInt(n(325)) / 3 * (parseInt(n(319)) / 4) + -parseInt(n(320)) / 5 * (parseInt(n(342)) / 6) + parseInt(n(314)) / 7 + -parseInt(n(341)) / 8 * (parseInt(n(332)) / 9) + -parseInt(n(338)) / 10 * (-parseInt(n(344)) / 11) === 544621)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
const I = { forward: "forward", back: g(323), moveTo: g(322), mark: "mark", turn: "turn", turnLeft: g(331), turnRight: "turnRight", faceTo: g(333), faceToMark: "faceToMark" };
function ye(n, t) {
  const e = xe();
  return (ye = function(i, r) {
    return e[i -= 314];
  })(n, t);
}
let Tn = Object[g(329)](I);
function xe() {
  const n = ["direction", "args", "7371238JJbddE", "forEach", "turnTo", "getMarks", "264218TvAwhP", "4aqtLSM", "455zDgjmy", "marks", "moveTo", "back", "addMarks", "1124049WIVzOk", "_direction", "reset", "419069WdcXmR", "keys", "onDirectionChanged", "turnLeft", "22761LRJBEH", "faceTo", "turnRight", "removeAllMarks", "hasListener", "number", "190AwkzIu", "dispatchEvent", "forward", "2072JnzRUr", "58866ZBglIo", "restoreToMark", "499576yeyTGN"];
  return (xe = function() {
    return n;
  })();
}
class at extends Fe {
  constructor(t, e) {
    super(t, e);
  }
}
const vt = {};
Tn[g(315)]((n) => {
  vt[n] = new at(n);
});
let An = new at(g(340)), Ln = new at("back"), Pn = new at("turn");
class jn {
  constructor(t, e, i) {
    const r = g;
    this.x = t, this.y = e, this[r(345)] = i;
  }
}
class On extends ot {
  constructor() {
    super(), this._x = 0, this._y = 0, this._direction = 0, this.reset();
  }
  onPositionChanged() {
  }
  onDirectionChanged() {
  }
  [g(327)]() {
    const t = g;
    return this.x = 0, this.y = 0, this.direction = 0, this[t(335)](), this;
  }
  moveTo(t, e) {
    const i = g;
    return typeof t == "number" && typeof e === i(337) ? (this.x = t, this.y = e) : typeof t == "object" && (this.x = t.x, this.y = t.y), this.hasListener(I.moveTo) && this[i(339)](new at(I[i(322)], { target: this, args: [t, e] })), this;
  }
  forward(t) {
    const e = g;
    return this.x += t * Math.cos(this.direction), this.y += t * Math.sin(this[e(345)]), this.hasListener(I.forward) && this.dispatchEvent(An), this;
  }
  back(t) {
    const e = g;
    this.forward(-t), this[e(336)](I[e(323)]) && this[e(339)](Ln);
  }
  [g(316)](t) {
    return this[g(345)] = t, this.hasListener(I.turn) && this.dispatchEvent(Pn), this;
  }
  turn(t) {
    return this.turnTo(this.direction + t);
  }
  turnLeft(t = Math.PI / 2) {
    const e = g;
    return this.turnTo(this[e(345)] - t);
  }
  [g(334)](t = Math.PI / 2) {
    return this.turnTo(this.direction + t);
  }
  faceTo(t, e) {
    const i = g;
    let r;
    typeof t == "number" && typeof e == "number" ? r = t : typeof t == "object" && (r = t.x, e = t.y);
    let o = Math.atan2(e - this.y, r - this.x);
    if (this[i(345)] = o, this[i(336)](I[i(333)])) {
      let s = vt[I[i(333)]];
      s[i(346)] = arguments[0], this.dispatchEvent(s);
    }
    return this;
  }
  mark(t) {
    const e = g;
    if (t == null)
      throw new Error("mark's name is required.");
    if (this.marks[t] = new jn(this.x, this.y, this[e(345)]), this[e(336)](I.mark)) {
      let i = vt[I.mark];
      i.args = t, this.dispatchEvent(i);
    }
    return this;
  }
  hasMark(t) {
    return this.marks[t] != null;
  }
  getMark(t) {
    let e = this.marks[t];
    if (e == null)
      throw new Error("mark '" + t + "' not found.");
    return e;
  }
  moveToMark(t) {
    let e = this.getMark(t);
    return this.moveTo(e.x, e.y), this;
  }
  [g(343)](t) {
    const e = g;
    let i = this.getMark(t);
    return this[e(322)](i.x, i.y), this.turnTo(i.direction), this;
  }
  [g(335)]() {
    this.marks = {};
  }
  removeMark(t) {
    const e = g;
    return !!this.hasMark(t) && (delete this[e(321)][t], !0);
  }
  [g(317)]() {
    return this.marks;
  }
  [g(324)](t) {
    const e = g;
    for (let i in t)
      this[e(321)][i] = t[i];
  }
  get x() {
    return this._x;
  }
  set x(t) {
    t != this._x && (this._x = t, this.onPositionChanged());
  }
  get y() {
    return this._y;
  }
  set y(t) {
    t != this._y && (this._y = t, this.onPositionChanged());
  }
  get [g(345)]() {
    return this[g(326)];
  }
  set direction(t) {
    const e = g;
    t != this[e(326)] && (this._direction = t, this[e(330)]());
  }
}
function L(n, t) {
  const e = we();
  return (L = function(i, r) {
    return e[i -= 288];
  })(n, t);
}
const $ = L;
function we() {
  const n = ["5PueuGf", "488094OMKjUn", "cancel", "292016MApvLI", "18sQvABJ", "defaultEffect", "moveToMark", "767392sdYQfK", "moveTo", "number", "then", "forward", "272361ojyvwa", "topo", "1885548BVqtve", "invalid arguments moveTo", "11emoctC", "duration", "146271MAofCS", "object", "faceTo", "5130670nUOnnY", "defaultAnimationOptions", "turn", "direction", "_anime", "6qfbMUh", "getMark"];
  return (we = function() {
    return n;
  })();
}
(function() {
  const n = L, t = we();
  for (; ; )
    try {
      if (parseInt(n(297)) / 1 + -parseInt(n(305)) / 2 * (parseInt(n(291)) / 3) + parseInt(n(314)) / 4 + parseInt(n(307)) / 5 * (-parseInt(n(308)) / 6) + -parseInt(n(293)) / 7 + -parseInt(n(310)) / 8 * (parseInt(n(311)) / 9) + parseInt(n(300)) / 10 * (parseInt(n(295)) / 11) === 155108)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class _n {
  constructor(t) {
    const e = L;
    this.defaultDuration = 1e3, this.defaultEffect = "easeLinear", this[e(301)] = { duration: 1e3, effect: "easeLinear" }, this[e(292)] = t, this.animation = new N();
  }
  setTopoAnimationOptions(t) {
    const e = L;
    this.defaultAnimationOptions[e(296)] = t.duration || 1e3, this.defaultAnimationOptions.effect = t.effect || "easeLinear";
  }
  moveTo(t, e, i) {
    const r = L;
    let o, s = this.topo;
    if (typeof t == "number" && typeof e === r(288))
      o = { x: t, y: e };
    else {
      if (typeof t !== r(298) || t.x == null || t.y == null)
        throw new Error(r(294));
      o = { x: t.x, y: t.y }, i = e;
    }
    return i == null && (i = this.defaultAnimationOptions), this._anime(I.moveTo, o, [s.x, s.y], [o.x, o.y], (l) => {
      s.x = l[0], s.y = l[1];
    }, i);
  }
  faceTo(t, e, i) {
    const r = L;
    let o, s = this.topo;
    if (typeof t == "number" && typeof e == "number")
      o = { x: t, y: e };
    else {
      if (typeof t != "object" || t.x == null || t.y == null)
        throw new Error("invalid arguments faceTo");
      o = { x: t.x, y: t.y }, i = e;
    }
    i == null && (i = this.defaultAnimationOptions);
    const l = s.direction;
    let a = Math.atan2(o.y - s.y, o.x - s.x), h = a - l;
    return h > Math.PI ? a = l - (2 * Math.PI - h) : h < -Math.PI && (a = l + (2 * Math.PI + h)), this[r(304)](I.faceTo, o, [l], [a], (c) => {
      s[r(303)] = c[0];
    }, i);
  }
  forward(t, e) {
    const i = L;
    let r = this.topo;
    const o = r.x + t * Math.cos(r.direction), s = r.y + t * Math.sin(r.direction);
    return this[i(304)](I.forward, t, [r.x, r.y], [o, s], (l) => {
      r.x = l[0], r.y = l[1];
    }, e);
  }
  back(t, e) {
    return this[L(290)](-t, e);
  }
  turn(t, e) {
    const i = L;
    let r = this.topo;
    const o = r.direction, s = o + t;
    return this[i(304)](I[i(302)], t, [o], [s], (l) => {
      r.direction = l[0];
    }, e);
  }
  turnLeft(t = Math.PI / 2, e) {
    return this.turn(-t, e);
  }
  turnRight(t = Math.PI / 2, e) {
    return this.turn(t, e);
  }
  turnTo(t, e) {
    const i = L;
    let r = this[i(292)];
    const o = r.direction;
    return this._anime(I[i(302)], t, [o], [t], (s) => {
      r[i(303)] = s[0];
    }, e);
  }
  [$(313)](t, e) {
    const i = $, r = this.topo[i(306)](t);
    return this[i(315)](r, e);
  }
  faceToMark(t, e) {
    const i = $, r = this.topo.getMark(t);
    return this[i(299)](r, e);
  }
  restoreToMark(t, e) {
    const i = this.topo.getMark(t), r = this.moveTo(i, e), o = this.turnTo(i.direction, e);
    return Promise.all([r, o]);
  }
  _anime(t, e, i, r, o, s) {
    const l = $;
    s == null && (s = this[l(301)]);
    let a = this.topo, h = this.animation;
    return h.setAttributes({ from: i, to: r, update: (c) => {
      o(c);
    }, duration: s[l(296)] || this.defaultDuration, effect: s.effect || this[l(312)] }), h.play()[l(289)](() => {
      if (a.hasListener(t)) {
        let c = vt[t];
        c.args = e, a.dispatchEvent(c);
      }
    });
  }
  abort() {
    const t = $;
    return this.animation && this.animation[t(309)](), this;
  }
}
const E = rt;
function ve() {
  const n = ["object", "throw", "8hbZQbD", "play", "isArray", "length", "635weoLeF", "2DPtwZV", "animation", "topo", "body", "atan2", "1852833UAgrAm", "splice", "animationSystem", "cancel", "sqrt", "176470cfdSOp", "sin", "11619sAWcOj", "indexOf", "defaultAnimationOptions", "832782LRALBb", "onDirectionChanged", "rotate", "map", "221546FTRiri", "1956GvNjGY", "489902kCuzNj", "carriedObjects", "direction", "407VMIDHe", "_stageRef", "throwTo", "2344NfsUpg", "48588SCpuVP"];
  return (ve = function() {
    return n;
  })();
}
function rt(n, t) {
  const e = ve();
  return (rt = function(i, r) {
    return e[i -= 332];
  })(n, t);
}
(function() {
  const n = rt, t = ve();
  for (; ; )
    try {
      if (-parseInt(n(343)) / 1 * (parseInt(n(358)) / 2) + -parseInt(n(348)) / 3 * (parseInt(n(338)) / 4) + parseInt(n(342)) / 5 * (parseInt(n(335)) / 6) + parseInt(n(364)) / 7 + -parseInt(n(334)) / 8 * (parseInt(n(355)) / 9) + parseInt(n(353)) / 10 * (-parseInt(n(367)) / 11) + parseInt(n(363)) / 12 * (parseInt(n(362)) / 13) === 777072)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Rn extends On {
  constructor(t) {
    const e = rt;
    super(), this.carriedObjects = [], this.animator = new Nn(this), this[e(332)] = t, t[e(350)].add(this.animator.animation);
  }
  onPositionChanged() {
    const t = rt;
    for (let e = 0; e < this.carriedObjects.length; e++)
      this[t(365)][e].setXY(this.x, this.y);
    this.body && this.body.setXY(this.x, this.y);
  }
  [E(359)]() {
    const t = E;
    for (let e = 0; e < this[t(365)].length; e++)
      this[t(365)][e][t(360)](this.direction);
    this.body && this[t(346)].rotate(this.direction);
  }
  setBody(t) {
    return this.body = t, this;
  }
  carry(t) {
    const e = E;
    return Array.isArray(t) ? this[e(365)] = this.carriedObjects.concat(t) : this.carriedObjects.push(t), this;
  }
  [E(337)](t, e = 0, i = 0) {
    const r = E;
    let o = this.x, s = this.y;
    if ((i > 0 || e != 0) && (o += i * Math.cos(this[r(366)] + e), s += i * Math.sin(this[r(366)] + e)), this.carriedObjects.includes(t)) {
      t.x = o, t.y = s;
      let l = this[r(365)].indexOf(t);
      this.carriedObjects.splice(l, 1);
    }
    return this;
  }
  throwTo(t, e, i) {
    const r = E;
    if (typeof e == "number" && typeof i == "number") {
      let o = Math[r(347)](i - this.y, e - this.x) - this.direction, s = Math.sqrt((e - this.x) ** 2 + (i - this.y) ** 2);
      return this.throw(t, o, s);
    }
    if (typeof e === r(336)) {
      let o = Math.atan2(e.y - this.y, e.x - this.x) - this[r(366)], s = Math[r(352)]((e.x - this.x) ** 2 + (e.y - this.y) ** 2);
      return this.throw(t, o, s);
    }
    throw new Error("invalid arguments throwTo");
  }
  putDown(t) {
    const e = E;
    if (this[e(365)].includes(t)) {
      t.x = this.x, t.y = this.y;
      let i = this[e(365)].indexOf(t);
      this.carriedObjects[e(349)](i, 1);
    }
    return this;
  }
  reset() {
    const t = E;
    return super.reset(), this.animator && this.animator[t(344)] && this.animator.animation[t(351)](), this;
  }
}
class Nn extends _n {
  constructor(t) {
    super(t);
  }
  carry(t, e) {
    const i = E;
    let r = this.topo;
    r.carry(t);
    let o = Array[i(340)](t) ? t : [t], s = o[i(361)]((h) => [h.x, h.y, h.rotation]), l = o.map((h) => [r.x, r.y, r[i(366)]]);
    e == null && (e = this[i(357)]);
    let a = new N();
    return a.setAttributes({ from: s.flat(), to: l.flat(), duration: e.duration || this.defaultAnimationOptions.duration, effect: e.effect, update: (h) => {
      const c = i;
      if (Number.isNaN(h[0]))
        throw new Error("args[0] is NaN");
      for (let u = 0; u < o[c(341)]; u++)
        o[u].x = h[3 * u], o[u].y = h[3 * u + 1], o[u].rotation = h[3 * u + 2];
    } }), this[i(345)]._stageRef[i(350)].add(a), a[i(339)]();
  }
  throw(t, e = 0, i = 0, r) {
    const o = E;
    let s = this[o(345)];
    if (!s[o(365)].includes(t))
      throw new Error("object is not in carriedObjects");
    r == null && (r = this.defaultAnimationOptions);
    let l = s.x, a = s.y;
    i > 0 && (l += i * Math.cos(s.direction + e), a += i * Math[o(354)](s[o(366)] + e)), e != 0 && (l += i * Math.cos(s.direction + e), a += i * Math.sin(s.direction + e));
    let h = new N();
    h.setAttributes({ from: [s.x, s.y], to: [l, a], duration: r.duration, effect: r.effect, update: (u) => {
      t.x = u[0], t.y = u[1];
    } }), this.topo._stageRef.animationSystem.add(h);
    let c = s.carriedObjects.indexOf(t);
    return this.topo.carriedObjects.splice(c, 1), h.play();
  }
  [E(333)](t, e, i, r) {
    const o = E;
    let s, l = this[o(345)];
    if (typeof e == "number" && typeof i == "number")
      s = { x: e, y: i };
    else {
      if (typeof e !== o(336) || e.x == null || e.y == null)
        throw new Error("invalid arguments throwTo");
      s = { x: e.x, y: e.y }, r = i;
    }
    r == null && (r = this.defaultAnimationOptions);
    let a = new N();
    a.setAttributes({ from: [l.x, l.y], to: [s.x, s.y], duration: r.duration, effect: r.effect, update: (c) => {
      t.x = c[0], t.y = c[1];
    } }), this.topo[o(332)].animationSystem.add(a);
    let h = l.carriedObjects[o(356)](t);
    return this.topo[o(365)].splice(h, 1), a.play();
  }
  putDown(t, e) {
    const i = E;
    let r = this.topo;
    r.putDown(t), e == null && (e = this.defaultAnimationOptions);
    let o = new N();
    return o.setAttributes({ from: [t.x, t.y], to: [r.x, r.y], duration: e.duration, effect: e.effect, update: (s) => {
      t.x = s[0], t.y = s[1];
    } }), this.topo[i(332)].animationSystem.add(o), o.play();
  }
}
function be() {
  const n = ["4272896iAdaIu", "20ZafoGU", "3083406wDEZtD", "appendChild", "925101iKNaaf", "getElementsByTagName", "24lRxPkR", "1630643IFsuqL", "3666940gvwYMg", "7846flMFBm", "textContent", "190rnwLAU", "464855BSilmh"];
  return (be = function() {
    return n;
  })();
}
function Ut(n, t) {
  const e = be();
  return (Ut = function(i, r) {
    return e[i -= 368];
  })(n, t);
}
(function() {
  const n = Ut, t = be();
  for (; ; )
    try {
      if (parseInt(n(369)) / 1 * (-parseInt(n(371)) / 2) + parseInt(n(375)) / 3 + parseInt(n(368)) / 4 + parseInt(n(372)) / 5 * (parseInt(n(379)) / 6) + -parseInt(n(380)) / 7 + -parseInt(n(373)) / 8 + -parseInt(n(377)) / 9 * (parseInt(n(374)) / 10) === 598412)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})(), function() {
  const n = Ut;
  let t = document.head || document[n(378)]("head")[0], e = document.getElementById("_jtopo_style_");
  e == null && (e = document.createElement("style"), e.id = "_jtopo_style_", e[n(370)] = `.jtopo_popoupmenu{padding:10px;border-radius:5px;min-width:210px;background-color:#fff;border:1px solid;position:absolute;z-index:10000}.jtopo_popoupmenu .header{font-size:14px;height:24px;padding-bottom:3px}.jtopo_popoupmenu a{text-rendering:optimizeLegibility;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding-left:20px;display:block;height:25px;color:#00000080;font-size:13px;cursor:pointer}.jtopo_popoupmenu a:hover{color:#000}.jtopo_iconsPanel{opacity:.98;padding:3px;position:absolute;background-color:#e8e8e8;top:20px;width:52px;z-index:1000;border-radius:5px}.jtopo_iconsPanel .item{border:1px solid white;width:42px;height:42px;margin:4px 2px 0}.jtopo_toolbar{border-bottom:1px dotted;padding-bottom:2px;border-color:#e0e0e0;width:100%;min-height:33px;background-color:#e8e8e8}.jtopo_toolbar .group{float:left;margin-right:5px}.jtopo_toolbar .item{float:left;width:32px;height:32px;stroke:gray;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;fill:none;font-size:12px;color:gray}.jtopo_toolbar .active{background-color:#d3d3d3;border:1px solid black}.jtopo_toolbar input[type=text]{font-size:12px;color:gray;float:left;width:120px;height:26px;border:1px solid white;margin:2px 2px 2px 4px}.jtopo_input_textfield{position:absolute;display:none;font-size:smaller;z-index:10000;border:1px gray dotted;padding:0;margin:0;word-break:none;word-wrap:none;outline:none;box-shadow:0 0 5px #0000ff80;overflow:hidden;resize:none}.jtopo_tooltip{pointer-events:none;opacity:.9;min-width:30px;min-height:30px;padding:10px;border-radius:5px;background-color:#f8f8f8;border:1px solid;position:absolute;z-index:10000}.jtopo_debugPanel{-webkit-user-select:none;user-select:none;border:dashed 1px gray;padding:8px;position:absolute;left:0;top:0%;width:300px;z-index:98;text-align:left;font-size:14px;color:gray}
`, t[n(376)](e));
}();
export {
  Fn as AssetsLoader,
  Be as BlinkingArrowNode,
  He as GifNode,
  Hn as InputTextfield,
  _e as InputTextfieldEvent,
  Ne as JointLNode,
  Bn as PopupMenu,
  Ft as RatioNode,
  De as RipplingNode,
  Wn as Toolbar,
  Dn as Tooltip,
  Rn as TopoRobot,
  We as WaterLikeNode
};
